Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

for

parfor

for loop.

Syntax

  • for variable = expression, statements, end
  • for variable, statements, end

Description

for loop executes a set of statements with an index variable looping through each element in a vector.

parfor is currently an alias on for keyword.

Examples

for i = 1:10, disp(i), end
for i = [1, 2; 3 4], disp(i), disp('next'), end

See also

while.

History

VersionDescription
1.0.0initial version

Author

Allan CORNET