运行单个仿真
直接从 Simulink® 编辑器运行和控制各个仿真,或者从 MATLAB® 命令提示符以编程方式运行和控制各个仿真
仿真模型可让您获得通过建模过程编译的算法的结果。您可以通过调整仿真速度、调整模型参数、停止或暂停仿真以及显示端口值来与仿真进行交互,以评估模型的设计。仿真可帮助您了解模型的设计和行为。
通过点击 Simulink 工具条中的运行按钮,或以编程方式使用 MATLAB 命令行窗口中的 sim
和 set_param
等函数或 MATLAB 脚本,以交互方式仿真模型。
有关运行并行和批量仿真的信息,请参阅运行多个仿真。
函数
对象
Simulink.SimulationInput | 创建 SimulationInput 对象以对多个或单个仿真的模型进行更改 |
Simulink.SimulationOutput | 访问仿真输出和元数据 |
Simulink.SimulationMetadata | Access metadata of simulation runs |
Simulink.op.ModelOperatingPoint | Complete information that represents model operating point in simulation |
主题
运行基本仿真
- 动态系统的仿真阶段
说明 Simulink 软件如何对动态系统进行仿真。 - 选择仿真模式
根据您的仿真需求,选择在普通、加速或快速加速模式下运行仿真。 - 以交互方式对模型进行仿真
以交互方式启动、暂停和停止仿真。 - 以编程方式运行仿真
使用sim
函数以编程方式进行模型仿真。 - Use Model Operating Point for Faster Simulation Workflow
Reduce the time required to run a set of simulations by simulating from an initial operating point.
分析仿真
- Simulation Pacing
Specify a pace to slow down simulations. - How Stepping Through Simulation Works
Learn how simulation snapshots work. - Debug Simulation Using Signal Breakpoints
Set breakpoints to pause simulation at points of interest then step through simulation block by block. - 显示端口值以进行调试
在仿真过程中在模块图上显示模块输出值。 - Operating Point Behavior
Considerations for using operating point with S-functions and modifying models you want to simulate from an initial operating point.
利用快速重启执行迭代仿真
- How Fast Restart Improves Iterative Simulations
Learn when to use fast restart for speeding up simulation. - 开始使用快速重启
配置模型,为快速重启仿真做准备。