Answered step by step
Verified Expert Solution
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 arrays
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started