Question: Write a function called genMatNoNeg that takes an n m array of integers called inMat and creates an m ouput array that replaces all the
Write a function called genMatNoNeg that takes an n m array of integers called inMat and creates an m ouput array that replaces all the negative numbers in inMat with zero. Restrictions: Logic indexing should be used. Loops should not be used. Ex: 4 S -2 -3 4 5 genMatNoNeg( inMat) produces outMat Your Function R Save Rest MATLAB Documentation :/function [outMat] #genMatNoNeg( nMat) 2 Replace all the negative numbers in 2D array with zero. outMat inMt 4Create a togical array with trues where entries are negative sidentifyNegPositions Complete the code 6, Use logical index iing to set all the negative values to s insert rest of code here Code to call your function C Reset inMat li, -2, 3: 4, 5, -6: 7, -8, 9) 2 outMat- genMatNoNeg inMat)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
