MATLAB Report Generator    

Logical and Flow Components

Logical and Flow components execute conditionally, enabling you to decide when a subcomponent will execute or how many times a subcomponent will execute.

Logical and Flow components have the following parent/child relationships.

For Loop.   This component iteratively runs its child components. The For Loop component must have at least one child. The purpose of this component is to run its children several times. If it does not have any children, then this component does not add anything to the report.

While Loop.   This component loops while a workspace expression is true. This component runs its subcomponents until its conditional string is true. The number of repetitions can be limited to prevent infinite loops. Similar to the For Loop component, the While Loop component must have at least one child. If it does not have any children, then this component does not add anything to the report.

The "If" Family.   There are three possible ways in which you can use the "If" family components.

Components Used
Appearance in the Outline
How the Components Execute
Logical If
if
  • When the if condition is true, this component will run its children.

Logical If, <if> then, <if> else
if
  • then
    else
    
    • When the if condition is true, only the children of the then component will run and the process will exit the if family.
    • When the if condition is false, only the children of the else component will run.
Logical If, <if> then, <if> elseif, <if> else
if
  • then
    elseif
    elseif
    
.
.
.
  • else
    
    • When the if condition is true, only the children of the then component will run and the process will exit the if family.
    • When the if condition is false, the process checks all the elseif statements in order, and the children of the first true elseif statement will run. The process will then exit the if family.
    • If none of the elseif statements is true, the process runs the children of the else statement.

Note that only one of the conditional statements (then, else, elseif) will actually execute.


  Handle Graphics Parameter <if> Else