事件函数
通过向默认模型初始化和终止方法中添加自定义例程,对动态启动和关闭行为进行建模。在仿真过程中,用事件控制方法何时执行。创建用初始值重新初始化模块的函数。
模块
模型设置
Parameter Writer 模块验证 | Globally or locally enable parameter validation (自 R2023a 起) |
主题
- Common Uses of the Initialize Function Block
This example shows how to use the Initialize Function block to perform these common initialization actions.
- 使用初始化、重新初始化、重置和终止函数
用初始化函数调用事件设置模块的状态。通过重新初始化或重置函数调用事件重置模块状态。用终止函数调用事件保存模块的状态。
- Create Test Harness to Generate Function Calls
Schedule initialize, reset, and terminate function-call events.
- Initialize, Reset, and Terminate State of Simulink Block
This example shows how to use the Initialize Function, Reset Function, and Terminate Function blocks to respond to events in a Simulink model.
- Initialize and Reset Parameter Values
Use the Parameter Writer block to change block parameter values during model simulation.
- 使用 Initialize Function 模块
此示例说明如何使用 Initialize Function 模块为子系统接收的每个函数调用事件重置 Discrete-Time Integrator 模块的初始条件。在此示例中,Initialize Function 模块在一个子系统内部,并且该子系统在每五个仿真时间步接收一个函数调用事件。
- Initialize, Reinitialize, Reset, and Terminate Function Limitations
Determine whether Initialize Function, Reinitialize Function, Reset Function, or Terminate Function blocks support a block, feature, or modeling pattern.
- Prepare Sensor and Controller Models in a Distributed Monitoring System for Code Generation
Prepare models to generate code for deployment on target hardware platforms.
- Use Parameter Writer Block to Change Block Parameters
This example shows how to use the Parameter Writer block to change the values of block parameters.
- Use Connectors Tool to Visualize Connections Between Blocks
This example shows how to use the Connectors tool to visualize the connections between blocks.
- Access Data Store at Higher Level in Model Hierarchy
Access data store defined at a higher-level in the model hierarchy.