迭代子系统
迭代子系统由控制模块启用后,会在当前时间步运行一次或多次。控制模块实现的控制逻辑类似于编程语言循环构造(例如 while
或 for
)所表达的逻辑。
这些迭代子系统适用于一般用例:
While Iterator Subsystem 模块 - 只要逻辑条件为 true,就重复执行算法。
For Iterator Subsystem 模块 - 重复执行算法,直到迭代变量超过指定的迭代限制。
For Each Subsystem模块 - 将算法应用于输入信号或封装参数的单个元素或子数组。
这些迭代子系统实现邻域模式,并针对图像和视频等大型输入数据进行了优化:
Neighborhood Processing Subsystem 模块 - 应用遵循邻域模式的算法。
Pixel Processing Subsystem 模块 - 将算法应用于多通道数据,如图像数据中的像素。
Array Processing Subsystem 模块 - 对大型数组的每个元素应用一种算法。
具有状态的 For Each 子系统中的每个模块为子系统处理的每个元素或子数组维护一组单独的状态。相反,While Iterator 和 For Iterator 子系统内的模块在子系统的连续迭代中使用相同的状态。邻域处理迭代子系统没有状态。
模块
主题
- 使用控制流逻辑
如何使用控制流模块对控制逻辑建模。
- 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.