for, while, and if statements.
while expressionstatementsendif expressionstatementsendfor expressionstatementsend
end terminates the scope of for, while, and if statements. Without an end statement, for, while, and if wait for further input. Each end is paired with the closest previous unpaired for, while, or if and serves to delimit its scope.
end used with for and if. Indentation provides easier readability.
for i = 1:nfor j = 1:nif i == ja(i,j) = 2;elseif abs(i;j) == 1a(i,j) = 1;elsea(i,j) = 0;endendend
break,for,if,return,while
(c) Copyright 1994 by The MathWorks, Inc.