Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

Simulink 调试器

使用 Simulink® 调试器可将模型中的问题追溯到特定的模块、参数或互连

Simulink 调试器允许您一次按一种方法运行仿真,并检查每种方法的执行结果。随着模型仿真的进行,您可以在 Simulink 编辑器中显示有关模块状态、模块输入和输出以及模块方法执行的信息。这样就可以将模型中的问题精确定位到具体的模块、参数或互连。

使用 Simulink 调试器可以:

  • 监视单个主时间步长期间的单个模块动态(例如,输出和更新)。

  • 查看执行主时间步长时的系统状态。

  • 观察单个主要步长期间的求解器动态。

Simulink 调试器必须处于活动状态(已启动)才能运行所有调试器命令。

Simulink 还支持使用仿真步进器进行调试,以便您向前和向后步进仿真、查看数据并检查系统状态何时以及如何发生变化。有关信息,请参阅How Simulation Stepper Helps With Model Analysis

函数

sldebug在调试模式下启动仿真

Simulink 调试器命令

ashowShow algebraic loop
atraceSet algebraic loop trace level for
bafterInsert breakpoint after specified method
breakInsert breakpoint before specified method
bshowShow specified block
clear从模型中清除断点
continue继续仿真
disp在仿真停止时显示模块的 I/O
ebreakEnable (or disable) breakpoint on solver errors
elistList simulation methods in order in which they are executed during simulation
emodeToggle model execution between accelerated and normal mode
etraceEnable or disable method tracing
helpDisplay help for debugger commands
nanbreakSet or clear nonfinite value break mode
nextAdvance simulation to start of next method at current level in model's execution list
probeI/O and state data for blocks
quit停止仿真调试器
rbreakBreak simulation before solver reset
runRun simulation to completion
slistSorted list of model blocks
statesCurrent state values
statusDebugging options in effect
stepAdvance simulation by one or more methods
stimesModel sample times
stop停止仿真
straceSet solver trace level
systemsList nonvirtual systems of model
tbreakSet or clear time breakpoint
trace每次模块执行时都显示模块的 I/O
undispRemove block from debugger's list of display points
untraceRemove block from debugger's list of trace points
whereDisplay current location of simulation in simulation loop
xbreakBreak when debugger encounters step-size-limiting state
zcbreakToggle breaking at nonsampled zero-crossing events
zclistList blocks containing nonsampled zero crossings

示例和操作指南

概念

相关信息