Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

Simulink 调试器

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

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

使用 Simulink Debugger 可以:

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

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

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

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

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
traceDisplay block's I/O each time block executes
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

示例和操作指南

启动 Simulink Debugger

如何从调试器启动仿真。

Start a Simulation

How to start a simulation in debug mode.

分步运行仿真

如何分步运行仿真。

设置断点

如何在模块和时间步处设置断点。

Display Information About the Simulation

How to display information about the current simulation.

Display Information About the Model

How to display information about the model being debugged.

Run Accelerator Mode with the Simulink Debugger

Use the Accelerator mode with the debugger.

概念

Introduction to the Debugger

Overview of the debugger.

Debugger Graphical User Interface

How to use the debugger graphical user interface.

Debugger Command-Line Interface

How to debug from the MATLAB® command line.

Debugger Online Help

How to get help on debugger commands.

相关信息