|On this page…|
Select Debug Model from a model window Simulation > Debug menu to display the debugger graphical interface.
The debugger toolbar appears at the top of the debugger window.
From left to right, the toolbar contains the following command buttons:
Step into the next method (see Stepping Commands for more information on this command, and the following stepping commands).
Step over the next method.
Step out of the current method.
Step to the first method at the start of next time step.
Step to the next block method.
Start or continue the simulation.
Pause the simulation.
Stop the simulation.
Break before the selected block.
Display inputs and outputs of the selected block when executed (same as trace gcb).
Display the current inputs and outputs of selected block (same as probe gcb).
Display help for the debugger.
Close the debugger.
To display the Breakpoints pane, select the Break Points tab on the debugger window.
The Breakpoints pane allows you to specify block methods or conditions at which to stop a simulation. See Set Breakpoints for more information.
To display the Simulation Loop pane, select the Simulation Loop tab on the debugger window.
The Simulation Loop pane contains three columns:
The Method column lists the methods that have been called thus far in the simulation as a method tree with expandable/collapsible nodes. Each node of the tree represents a method that calls other methods. Expanding a node shows the methods that the block method calls. Clicking a block method name highlights the corresponding block in the model diagram.
Whenever the simulation stops, the debugger highlights the name of the method where the simulation has stopped as well as the methods that invoked it. The highlighted method names indicate the current state of the method call stack.
The breakpoints column consists of check boxes. Selecting a check box sets a breakpoint at the method whose name appears to the left of the check box. See Setting Breakpoints from the Simulation Loop Pane for more information.
The ID column lists the IDs of the methods listed in the Methods column. See Method ID for more information.
To display the Outputs pane, select the Outputs tab on the debugger window.
The Outputs pane displays the same debugger output that would appear in the MATLAB® command window if the debugger were running in command-line mode. The output includes the debugger command prompt and the inputs, outputs, and states of the block at whose method the simulation is currently paused (see Block Data Output). The command prompt displays current simulation time and the name and index of the method in which the debugger is currently stopped (see Block ID).
To display the Sorted List pane, select the Sorted List tab on the debugger window.
The Sorted List pane displays the sorted lists for the model being debugged. See Display Model's Sorted Lists for more information.