MATLAB: For loop weired code

for loop

What does
for i=L :-1:1
mean, is it reverse loop or what?

Best Answer

Yes. It goes from L, which is presumably bigger than 1, down to 1 in steps of 1. For example if L = 5, i will take on values 5,4,3,2,1 in that order.