Question: MATH MODELING USING MATLAB in matlab open up a new script file, type the command and explain line by line what the code is doing

MATH MODELING USING MATLAB

in matlab open up a new script file, type the command and explain line by line what the code is doing ;also run it

x_array = 1:10;

for i = 1:10

if mod (x_array(i),3) == 1

disp( x_array(i) )

elseif mod(x_array(i),3) == 2

disp( -x_array(i) )

else

disp( x_array(i) *10 )

end

end

i have the final output already i just need the explanation of what each line is doing

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!