Main Content

For Loop

Iteratively execute child components


This component functions like the MATLAB® for loop, except that instead of executing a statement, it executes its child components. It must have at least one child component to execute.

Loop Type

The loop type can have incremented indices or a vector of indices. For more information on for loops and indices, see for.

  • Incremented indices: Executes a for loop of the form:

    for varname=x:y:z

    • Start: Corresponds to x in the previous expression.

    • Increment: Corresponds to y in the previous expression.

    • End: Corresponds to z in the previous expression.

  • Vector of Indices: Executes a for loop of the form:

    for varname=[a b c ...]
    Specify appropriate values in the Vector field in the form a b c ...

Workspace Variable

  • Show index value in base workspace: Displays the loop index in the MATLAB workspace while other components execute.

  • Variable name: Allows you to specify the variable name. The default is RPTGEN_LOOP.

  • Remove variable from workspace when done: Removes the loop index from the MATLAB workspace. This option is only available if you select the Show index value in base workspace option.

Insert Anything into Report?