Question: pls help!! What does the following script do? x=round(rand(1,10)20); for i=1 :length (x) if x(i)==13 x(i)=0; end end Generates 20 random integers from 0 to


What does the following script do? x=round(rand(1,10)20); for i=1 :length (x) if x(i)==13 x(i)=0; end end Generates 20 random integers from 0 to 10 and then sets 13 of them equal to 0 Generates 20 random numbers from 0 to 10 and replaces number 0 with 13 Generates 10 random integers from 0 to 20 and then replaces any number 13 with None of the above What does the variable factor calculate at the end of the script? x=5;factor=1;fork=1:xfactor=factor+k2; end factor 1+1+2+3+4+51+1+4+9+16+2511425491192549 What does the counter1 provide at the end of this script? if x(i)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
