Using Simulink    

Setting Breakpoints at Blocks

The debugger lets you specify a breakpoint at the beginning of the execution of a block or at the end of the execution of a block (command-line mode only).

Specifying a Breakpoint at the Start of a Block's Execution

Setting a breakpoint at the beginning of a block causes the debugger to stop the simulation when it reaches the block on each time step. You can specify the block on which to set the breakpoint graphically or via a block index in command-line mode. To set a breakpoint graphically at the beginning of a block's execution, select the block in the model window and click on the debugger's toolbar or enter

at the debugger command line. To specify the block via its block index (command-line mode only), enter

where s:b is the block's index (see Block Indexes).

In GUI mode, the debugger's Break/Display points panel displays the blocks where breakpoints exist.

Setting a Breakpoint at the End of a Block's Execution

In command-line mode, the debugger allows you to set a breakpoint at the end of a block's execution, using the bafter command. As with break, you can specify the block graphically or via its block index.

Clearing Breakpoints from Blocks

To clear a breakpoint temporarily, clear the first check box next to the breakpoint in the Break/Display points panel (GUI mode only). To clear a breakpoint permanently in GUI mode, select the breakpoint in the Break/Display points panel and click the Remove selected point button. In command-line mode use the clear command to clear breakpoints. You can specify the block by entering its block index or by selecting the block in the model diagram and entering gcb as the argument of the clear command.


  Setting Breakpoints Setting Breakpoints at Time Steps