Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is Matlab, Cant use any loops here, just row indexing and relating arrays No Negatives Write a function genMatNoNeg that take a nx m

This is Matlab, Cant use any loops here, just row indexing and relating arraysimage text in transcribed

No Negatives Write a function genMatNoNeg that take a nx m array inMat of integers and create a X ouput array that replaces all the negative numbers in inMat with zero. Hint: Use logic indexing and the internal function randi. Restriction: You may not use loops. For example: inMat 4 4 5 2; 3 4 5] genMatNoNeg( inMat) produces outMat 4 Your Function Save C Reset | MATLAB Documentation 1 function [out-lat] genMatNoNeg( inMat) = 3 % Your solution goes here % 5 end Code to call your function C Reset 1 inMat-rand (10,3,3); 2outMatgenMatNoNeg( inMat)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago