|On this page…|
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. Use sldebug for this purpose. The debugger accepts abbreviations for debugger commands. For more information on debugger commands, see Debugging.
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 indexes sequentially, starting with 0.
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 form sysIdx:blkIdx, where sysIdx is an integer identifying the system that contains the block (either the root system or a nonvirtual subsystem) and blkIdx is the position of the block in the system's sorted list. For example, the block ID0:1 refers to the first block in the model's root system. The slist command shows the block ID for each debugged block in the model.
You can enter any MATLAB expression at the sldebug prompt. For example, suppose you are at a breakpoint and you are logging time and output of your model as tout and yout. 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 the eval command to work around this problem. For example, use eval('s') to determine the value of s rather than s(tep) the simulation.