Using Simulink     Search    Help Desk 

Stepping by Blocks

To advance a simulation one block, enter step at the debugger prompt. The debugger executes the current block, stops, and highlights the next block in the model's block execution order (see "Displaying a Model's Block Execution Order"). For example, the following figure shows the vdp block diagram after execution of the model's first block.


If the next block to be executed occurs in a subsystem block, the debugger opens the subsystem's block diagram and highlights the next block.

After executing a block, the debugger prints the block's inputs (U) and outputs (Y) and redisplays the debug command prompt in the MATLAB command window. The debugger prompt shows the next block to be evaluated.

Crossing a Time Step Boundary

When you step through the last block in the model's sorted list, the debugger advances the simulation to the next time step and halts the simulation at the beginning of the first block to be executed in the next time step. To signal that you have crossed a time step boundary, the debugger prints the current time in the MATLAB command window. For example, stepping through the last block of the first time step of the vdp model results in the following output in the MATLAB command window.

Stepping by Minor Time Steps

You can step by blocks within minor time steps, as well as within major steps. To step by blocks within minor time steps, enter minor at the debugger command prompt.



[ Previous | Help Desk | Next ]