Main Content

Debugger Command-Line Interface

Controlling the Debugger

In command-line mode, you control the debugger by entering commands at the debugger command line in the MATLAB®Command Window. To enter commands at the debugger command line, you must start the debugger programmatically and not through the GUI. Usesldebugfor this purpose. The debugger accepts abbreviations for debugger commands. For more information on debugger commands, seeSimulink Debugger.

Note

You can repeat some commands by entering an empty command (i.e., by pressing theEnterkey) at the command line.

Method ID

Some of the Simulink®software commands and messages use method IDs to refer to methods. A method ID is an integer assigned to a method the first time the method is invoked. The debugger assigns method IDs sequentially, starting with 0.

Block ID

Some of the debugger commands and messages use block IDs to refer to blocks. Block IDs are assigned to blocks while generating the model's sorted lists during the compilation phase of the simulation. A block ID has the formsysIdx:blkIdx, wheresysIdxis an integer identifying the system that contains the block (either the root system or a nonvirtual subsystem) andblkIdxis the position of the block in the system's sorted list. For example, the block ID0:1refers to the first block in the model's root system. Theslistcommand shows the block ID for each debugged block in the model.

访问theMATLABWorkspace

You can enter any MATLAB expression at thesldebugprompt. For example, suppose you are at a breakpoint and you are logging time and output of your model astoutandyout. The following command creates a plot.

(sldebug ...) plot(tout, yout)

You cannot display the value of a workspace variable whose name is partially or entirely the same as that of a debugger command by entering it at the debugger command prompt. You can, however, use theevalcommand to work around this problem. For example, useeval('s')to determine the value ofsrather thanstepthe simulation.

Related Examples

More About