Desktop Tools and Development Environment Previous page   Next Page

Setting Breakpoints

Set breakpoints to pause execution of the function so you can examine values where you think the problem might be. You can set breakpoints in the Editor/Debugger, using functions in the Command Window, or both.

There are three basic types of breakpoints you can set in M-files:

You can disable standard and conditional breakpoints so that MATLAB temporarily ignores them, or you can remove them. For details, see Disabling and Enabling Breakpoints. Breakpoints are not maintained after you exit the MATLAB session.

You can only set valid standard and conditional breakpoints at executable lines in saved files that are in the current directory or in directories on the search path. When you add or remove a breakpoint in a file that is not in a directory on the search path or in the current directory, a dialog box appears, presenting you with options that allow you to add or remove the breakpoint. You can either change the current directory to the directory containing the file, or you can add the directory containing the file to the search path.

You cannot set breakpoints while MATLAB is busy, for example, running an M-file, unless that M-file is paused at a breakpoint.


Previous page  Preparing for Debugging Setting Standard Breakpoints Next page

© 1994-2005 The MathWorks, Inc.