The Simulink debugger allows you to run a simulation one method at a time, and examine the results of executing each method. As the model simulates, you can display information on block states, block inputs and outputs, and block method execution within the Simulink Editor. This allows you to pinpoint problems in your model to specific blocks, parameters, or interconnections.
Use the Simulink debugger to:
Monitor single block dynamics (for example, output and update) during a single major time step.
Look at state of system while executing a major time step.
Observe solver dynamics during a single major step.
Simulink Debugger must be active (started) for all the debugger commands to run.
Simulink also supports debugging with the Simulation Stepper, which lets you step back and forth through your simulation, viewing data and inspecting how and when the system changes states. For information, see How Simulation Stepper Helps With Model Analysis.
sldebug | Start simulation in debug mode |
ashow | Show algebraic loop |
atrace | Set algebraic loop trace level for |
bafter | Insert breakpoint after specified method |
break | Insert breakpoint before specified method |
bshow | Show specified block |
clear | Clear breakpoints from model |
continue | Continue simulation |
disp | Display block's I/O when simulation stops |
ebreak | Enable (or disable) breakpoint on solver errors |
elist | List simulation methods in order in which they are executed during simulation |
emode | Toggle model execution between accelerated and normal mode |
etrace | Enable or disable method tracing |
help | Display help for debugger commands |
nanbreak | Set or clear nonfinite value break mode |
next | Advance simulation to start of next method at current level in model's execution list |
probe | I/O and state data for blocks |
quit | Stop simulation debugger |
rbreak | Break simulation before solver reset |
run | Run simulation to completion |
slist | Sorted list of model blocks |
states | Current state values |
status | Debugging options in effect |
step | Advance simulation by one or more methods |
stimes | Model sample times |
stop | Stop simulation |
strace | Set solver trace level |
systems | List nonvirtual systems of model |
tbreak | Set or clear time breakpoint |
trace | Display block's I/O each time block executes |
undisp | Remove block from debugger's list of display points |
untrace | Remove block from debugger's list of trace points |
where | Display current location of simulation in simulation loop |
xbreak | Break when debugger encounters step-size-limiting state |
zcbreak | Toggle breaking at nonsampled zero-crossing events |
zclist | List blocks containing nonsampled zero crossings |
How to start a simulation from the debugger.
How to start a simulation in debug mode.
How to run a simulation step by step.
How to set breakpoints at blocks and time steps.
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
How to use the Accelerator mode with 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.
How to get help on debugger commands.