Wednesday, 27 July 2016

MATLAB Programming 35 - while loop

The while Loop


The while loop repeatedly executes statements while condition is true.

Syntax


The syntax of a while loop in MATLAB is:

while <expression>
       <statements>
end

The while loop repeatedly executes program statement(s) as long as the expression remains true.

An expression is true when the result is nonempty and contains all nonzero elements (logical or real numeric). Otherwise, the expression is false.


No comments:

Post a Comment