Iterator Subsystems
An iterator 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
programming language loop constructs such as while
or
for
.
These iterator subsystems apply to general use cases:
While Iterator Subsystem block — Repeat execution of an algorithm as long as a logical condition is true.
For Iterator Subsystem block — Repeat execution of an algorithm until an iteration variable exceeds a specified iteration limit.
For Each Subsystem block — Apply an algorithm to individual elements or subarrays of input signals or mask parameters.
These iterator subsystems implement the neighborhood pattern and are optimized for large input data such as images and video:
Neighborhood Processing Subsystem block — Apply an algorithm that follows the neighborhood pattern.
Pixel Processing Subsystem block — Apply an algorithm to multichannel data such as pixels in image data.
Array Processing Subsystem block — Apply an algorithm to each element of a large array.
Each block inside a For Each subsystem that has states maintains a separate set of states for each element or subarray processed by the subsystem. By contrast, blocks inside While Iterator and For Iterator subsystems use the same states throughout successive iterations of the subsystem. The neighborhood processing iterator subsystems do not have states.
Blocks
Topics
- Use Control Flow Logic
How to use control flow blocks to model control logic.
- Iterate Subsystem Execution with While Iterator and For Iterator Subsystems
Execute subsystem multiple times during time step in response to control block.
- Repeat an Algorithm Using a For-Each Subsystem
Iterate algorithm over groups of signals, subsystems, and parameters.
- Log Signals in For-Each Subsystems
Use signal logging in For Each subsystems.
- Create Model That Performs Neighborhood Processing
Blur an image by using Neighborhood Processing Subsystem blocks.
- Specify Region of Interest for Neighborhood Processing
Configure a Neighborhood Processing Subsystem block to iterate over a subsection of an input matrix.
- Use Neighborhood Processing Subsystem Block Padding Options with Region of Interest
Configure the Neighborhood Processing Subsystem block to pad values outside the input matrix.