Loops
Loops
for k = 5:10:35
x = k^2
end
• Note: k takes on the values 5, 15, 25, and 35, and x takes on the values
25, 225, 625, and 1225.
• The program then continues to execute any statements following the end
statement.
FLOWCHART OF A FOR LOOP.
NOTES ON LOOP VARIABLE EXPRESSION
K = M:S:N