以编程方式调试仿真
在 MATLAB® 命令行窗口中调试和分析仿真,设置断点,步进时间步和模块方法
Simulink® 调试编程接口在 MATLAB 命令行窗口中提供与 Simulink 编辑器中类似的调试选项。此外,您还可以使用编程接口来执行以下操作:
以一次执行一个模块方法的方式步进模型仿真。
在模块方法上设置断点。
设置其他模型断点,如求解器重置断点。
显示有关模型的其他信息,包括非虚拟子系统的列表。
仅在启动调试会话后,仿真调试会话中用于控制数据显示和模型执行的函数才可用。
函数
开始仿真调试会话
sldebug | 启动 Simulink 模型的仿真调试会话 |
控制仿真调试会话中的模型执行
bafter | Insert breakpoint after specified method in simulation debugging session |
break | Insert breakpoint before specified method in simulation debugging session |
clear | 清除仿真调试会话中的断点 |
continue | 继续仿真调试会话 |
ebreak | Set or clear breakpoint to pause when solver error occurs in simulation debugging session |
emode | Switch between accelerator and normal mode during simulation debugging session |
nanbreak | Set or clear breakpoint to pause when Inf or
NaN value occurs in simulation debugging session |
next | Progress simulation debugging session to start of next method in model execution list |
quit | 结束仿真调试会话 |
rbreak | Configure simulation debugging session to pause before solver reset |
run | Run simulation debugging session from current point to end of simulation, ignoring breakpoints |
step | Advance simulation by specified increment |
stop | 停止仿真调试会话 |
tbreak | Set or clear breakpoint that pauses simulation debugging session at specified time |
xbreak | Set or clear breakpoint to pause when state limits step size in simulation debugging session |
zcbreak | Configure simulation debugging session to pause when nonsampled zero-crossing events occur |
在仿真调试会话中显示信息
ashow | Identify and highlight algebraic loops in simulation debugging session |
atrace | Configure simulation debugging session to display information each time algebraic loop is solved |
bshow | Highlight block in model with specified block ID during simulation debugging session |
disp | 当仿真调试会话暂停时,显示有关指定模块的信息 |
elist | Display execution order in simulation debugging session |
etrace | Configure simulation debugging session to display information when entering and exiting methods |
help | Display help for Simulink debugging programmatic interface during simulation debugging session |
probe | Display input, output, and state data for specified block in simulation debugging session |
slist | Display sorted list of blocks in model during simulation debugging session |
states | Display state values during simulation debugging session |
status | Display options used in current simulation debugging session |
stimes | Display information about sample times in model during simulation debugging session |
strace | Display solver information in simulation debugging session |
systems | List nonvirtual subsystems in model or model hierarchy during simulation debugging session |
trace | 每次模块执行时,在仿真调试会话中显示指定模块的信息 |
undisp | Remove display point in simulation debugging session |
untrace | Remove trace point in simulation debugging session |
where | Display current location within simulation loop during simulation debugging session |
zclist | List blocks that detect zero crossings in simulation debugging session |
主题
- Simulink Debugging Programmatic Interface
Learn the basics of the Simulink debugging programmatic interface.
相关信息
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)