Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

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_2

Step: 3

blur-text-image_3

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

Students also viewed these Databases questions