Iteration - English

23501 visits



Outline:

Iteration Explain syntax of 'for' statement- tell that the variable iterates over a list/vector/matrix (or an expression that evaluates to any of these). Give example: for i = 1:5, disp (i), end Then explain break condition. Use example: for i = 1:10, disp(i), if (i==5), break, end, end Then explain continue condition. Use example: for i = 1:10, if (i<=5) then continue, else disp(i), end, end Explain while condition. Give example: i = 0; while(i <=5), i = i + 1; d