Debug Simulations Programmatically - MATLAB & Simulink (original) (raw)

Main Content

Debug and analyze simulations in the MATLABĀ® Command Window, set breakpoints, step through time steps and block methods

The SimulinkĀ® debugging programmatic interface provides debugging options in the MATLAB Command Window that are similar to those available in the Simulink Editor. In addition, you can use the programmatic interface to:

The functions for controlling data display and model execution in a simulation debugging session are available only after you start the debugging session.

Functions

expand all

sldebug Start simulation debugging session for Simulink model
bafter Insert breakpoint after specified method in simulation debugging session
break Insert breakpoint before specified method in simulation debugging session
clear Clear breakpoint in simulation debugging session
continue Continue simulation debugging session
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 orNaN value occurs in simulation debugging session
next Progress simulation debugging session to start of next method in model execution list
quit End simulation debugging session
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 Stop simulation debugging session
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 Display information about specified block when simulation debugging session pauses
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 Display information about specified block each time block executes in simulation debugging session
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

Topics