sldebug
Start simulation debugging session for Simulink model
Syntax
Description
sldebug(
starts a programmatic
simulation debugging session for the model specified by mdl
)mdl
. The
simulation starts and pauses just before the initialization phase.
When you start a programmatic simulation debugging session, the MATLAB® command prompt becomes the sldebug
command prompt.
Instead of >>
, you see (sldebug @0): >>
. To
control the debugging session, enter commands in the MATLAB Command Window, at the sldebug
command prompt,
using the Simulink® debugging programmatic interface.
During a programmatic simulation debugging session, you can use the debugging functions to:
Set model, signal, and block breakpoints
Run the simulation one block method at a time
Run the simulation one time step at a time
Continue the simulation to the next breakpoint
Examine simulation data
To end a programmatic simulation debugging session, use the stop
function.
Examples
Input Arguments
Tips
As an alternative to programmatic debugging, you can debug and analyze models in the Simulink Editor using similar functionality available in the Simulink Toolstrip. Using the Debug tab, you can:
Add breakpoints that pause simulation within a time step
Step from one major time step to the next
Step from one block output method to the next
Step into and out of atomic subsystems, model references, and Stateflow® charts
Add port value labels to display block output values for major time steps
View the execution order
Annotate the block diagram with sample time information
To start a simulation debugging session interactively, add one or more breakpoints to your model and in the Breakpoints List, check that Pause within time step is selected. When the simulation pauses on a breakpoint, some of the programmatic debugging commands, such as the stop
command, are available for use in the MATLAB Command Window.
When you start a simulation debugging session interactively, the simulation pauses just before executing the first block output method.
Version History
Introduced in R2006a