This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

While Loop

Iteratively execute child components while a specified condition is true


This component iteratively executes its child components while a specified condition is true. The While Loop component must have at least one child component; the purpose of this component is to run its children several times. If it does not have any children, this component does not add anything to the report.


Limit the number of repetitions to prevent infinite loops.

Logic Properties

  • Continue looping if this expression is true: Specifies an expression to evaluate. This expression must be a valid MATLAB® expression that evaluates to 1 or 0 (true or false).

    For example, if a = 1, b = 2, and c = 3, the following command:

       d = 1
    Because 1 is greater than b/c (2/3), this expression is true and evaluates to 1.

  • Limit number of loops to: Allows you to prevent infinite loops. Use the left and right arrows to increase or decrease the number of loops.

  • Initialize with this expression: Initializes the loop with a valid MATLAB expression.

Insert Anything into Report?

Yes, if it has a child component.



Was this topic helpful?