You shouldn't have to actually activate those 'for-loops' to determine how many times they will execute. You can do it in your head. The first one advances by one each step:, -32768, -32767, -32766, ..., 32767, so you just count the number of these integers, namely 32767 - (-32768) + 1 = ?. The second one is "none"; 32768 is already too far. The third one has 2 only since 2+4 would be beyond 3 and therefore it executes just once. The last one you can read about at:
http://www.mathworks.com/help/matlab/ref/for.html
"The loop executes a maximum of n times, where n is the number of columns of valArray, given by numel(valArray,1,:)."
Best Answer