迭代子系统
迭代子系统由控制模块启用后,会在当前时间步运行一次或多次。控制模块实现的控制逻辑类似于编程语言循环构造(例如 while
或 for
)所表达的逻辑。
只要逻辑条件为 true,就使用 While Iterator Subsystem 模块重复执行算法。
使用 For Iterator Subsystem 模块重复执行算法,直到迭代变量超过指定的迭代限制。
使用 For Each Subsystem 模块将算法应用于输入信号或封装参数的单个元素或子数组。
使用 Neighborhood Processing Subsystem 模块应用遵循邻域模式的算法。
具有状态的 For Each 子系统中的每个模块为子系统处理的每个元素或子数组维护一组单独的状态。相反,While Iterator 和 For Iterator 子系统内的模块在子系统的连续迭代中使用相同的状态。Neighborhood Processing Subsystem 模块没有状态。
模块
While Iterator Subsystem | 当逻辑表达式为 true 时,在仿真时间步中重复执行子系统 |
For Iterator Subsystem | 在仿真时间步内重复执行指定迭代次数的子系统 |
For Each Subsystem | 将算法应用于输入信号或封装参数的单个元素或子数组 |
Neighborhood Processing Subsystem | Create algorithm that follows the neighborhood pattern (自 R2022b 起) |
主题
- 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
You can configure the Neighborhood Processing Subsystem block to pad values outside the input matrix using different padding methods.