Using Simulink     Search    Help Desk 

Starting the Debugger

Use the sldebug command or the debug option of the sim command to start a model under debugger control. (See sim for information on specifying sim options.)

For example, either the command

or the command

loads the Simulink demo model, vdp, into memory and pauses at the first block in the first time step. The debugger highlights the model's initial block and associated output signal lines in the model diagram. The next figure shows the vdp block diagram as it appears on debug mode start-up.


The debugger also prints the simulation start time and a debug command prompt in the MATLAB command window. The command prompt displays the block index (see "About Block Indexes") and name of the first block to be executed. For example, the command in the preceding example results in the following output in the MATLAB command window.

At this point, you can get help, run the simulation step-by-step, examine data, or perform other debugging tasks by entering debugger and other MATLAB commands at the debug prompt. The following sections explain how to use the debugger commands.



[ Previous | Help Desk | Next ]