Question: MATLAB ONLY!! 1. Vectorize the following code snippets: a. (15 pts.) M = randi ([-10 10],10,10); [m, n] = = size (M); out = zeros

MATLAB ONLY!!

MATLAB ONLY!! 1. Vectorize the following code snippets: a. (15 pts.) M

1. Vectorize the following code snippets: a. (15 pts.) M = randi ([-10 10],10,10); [m, n] = = size (M); out = zeros (m, n) ; for x = 1:m for y = 1:n if M(x, y) > 0 out (x, y) 0; elseif M(x, y) 0 out (x, y) ; else out (x, y) =-1; end end end 3 b. (10 pts.) result = zeros (100,100); for x = 1:100 for y = 1:100 result(x, y) = sqrt(x^2+y^2); end end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!