Using Simulink Previous page   Next Page

Debugging Embedded MATLAB Functions

Use the following tools during an Embedded MATLAB function debugging session:

Tool Button
Description

A breakpoint indicator. To set a breakpoint for a line of function code, click the hyphen character (-) in the breakpoints column for the line. A breakpoint indicator appears in place of the hyphen. Click the breakpoint indicator to clear the breakpoint.

Build
Check for errors and build a simulation application (if no errors are found) for the model containing this Embedded MATLAB function.
Start Simulation
Start simulation of the model containing the Embedded MATLAB function.
Alternatively, press F5, or, from the Debug menu, select Start.
Stop Simulation
Stop simulation of the model containing the Embedded MATLAB function. You can also select Exit debug mode from the Debug menu if execution is paused at a breakpoint.
Pause Simulation
Temporarily stop execution during simulation. To continue with execution, click the Start Simulation tool .
Set/Clear Breakpoint
Set a new breakpoint or clear an existing breakpoint for the selected Embedded MATLAB code line. The presence of the text cursor or highlighted text selects the line.
Clear All Breakpoints
Clear all set breakpoints in the Embedded MATLAB function.
Step
Step through the execution of the next Embedded MATLAB code line. This tool steps past function calls and does not enter called functions for line-by-line execution. You can use this tool only after execution has stopped at a breakpoint. Alternatively, press F11, or, from the Debug menu, select Step.
Step In
Step through the execution of the next Embedded MATLAB code line. If the line calls a subfunction, step into line-by-line execution of the subfunction. You can use this tool only after execution has stopped at a breakpoint.
Step Out
Step out of line-by-line execution of the current subfunction to the line after the line that calls this subfunction. You can use this tool only after execution has stopped at a breakpoint.

See Debugging the Function in Simulation for an example using some of these debugging tools.


Previous page  Defining Embedded MATLAB Function Arguments Typing Function Arguments Next page

© 1994-2005 The MathWorks, Inc.