Question: Consider the MATLAB script inside the box: clear; x [-5 4 1 21; for klength (x):-2:1 if x(k) > 0 y (k)x(k) + 1;
Consider the MATLAB script inside the box: clear; x [-5 4 1 21; for klength (x):-2:1 if x(k) > 0 y (k)x(k) + 1; else y (k) 2*x(k); end 1:2:length (y) end for k z (k) y (k); end; if Part I: (must be solved on paper and then reported in a Word document without the use of the MATLAB software): After the MATLAB script is run, what are the variables y, z, and r equal to (their contents)? You must show your work clearly and justify your answers. Final correct answers without rigorous justifications will receive no credit. 1)y-? 2) z=? any (x >1 & x < 1) I = x.^2; elseif sum (x < 3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
