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. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Logical Conditionally Executed Subsystems

Control when a subsystem is executed

A logically executed subsystem runs one or more times at the current time step when enabled by a control block. A control block implements control logic similar to that expressed by a programming language statement (e.g., if-then, switch, while, for).

Blocks

expand all

IfSelect subsystem execution using logic similar to if-else statement
If Action SubsystemSubsystem whose execution is enabled by an If block
Switch CaseSelect subsystem execution using logic similar to a switch statement
Switch Case Action SubsystemSubsystem whose execution is enabled by a Switch Case block
Action PortAdd control port for action signal to subsystem
While IteratorRepeat execution of a subsystem while a logical expression is true
While Iterator SubsystemSubsystem that repeats execution during a simulation time step
For IteratorRepeat execution of a subsystem during a time step for a specified number of iterations
For Iterator SubsystemSubsystem that repeats execution during a simulation time step
For EachProcess elements or subarrays of a mask parameter or input signal independently
For Each SubsystemSubsystem that repeats execution on each element or subarray of input signal and concatenates results

Topics

Select Subsystem Execution

Execute subsystem once during a time step in response to an action signal.

Iterate Subsystem Execution

Execute subsystem multiple times during a time step in response to a control block.

Repeat an Algorithm Using a For Each Subsystem

Iterate an algorithm over groups of signals, subsystems, and parameters.

Log Signals in For Each Subsystems

Use signal logging in For Each subsystems.

Featured Examples