MATLAB: When for statment stop …. (what the below two conditions means? )

for loop

for idx = 1:length(time)-1
idx/length(time)*100;
anyone can explain this conditions?

Best Answer

Then mean that in the for the loop the idx will take values from 1 to length(time)-1. For example,
time = [1 3 5 7];
here length(time)=4 therefore idx will take value from the following set
1:3 = [1 2 3]
and the loop will run 3 times. Refer here for details: https://www.mathworks.com/help/matlab/ref/for.html.
Related Question