break

exit evaluation loop.

Syntax

  • break

Description

break statement is used to exit a loop prematurely.

break statement can be used inside a for or a while loop.

Example

for i = 1:10
  if i == 5
   disp('i == 5');
   break;
  end
  disp(i)
end

See also

return.

History

VersionDescription

1.0.0

initial version

Author

Allan CORNET

Last updated