Set breakpoints for debugging
dbstop in
sets
a breakpoint at the first executable line in file
file
.
When you run file
, MATLAB® enters debug mode,
pauses execution at the breakpoint, and displays the line where it
is paused.
dbstop in
sets
a breakpoint at the specified location. MATLAB execution pauses
immediately before that location, unless the location is an anonymous function.
If the location is an anonymous function, then execution pauses just
after the breakpoint.file
at location
dbstop in
sets
a conditional breakpoint at the first executable line of the file.
Execution pauses only if file
if expression
expression
evaluates to
true (1)
.
dbstop in
sets
a conditional breakpoint at the specified location. Execution pauses
at or just before that location only if the file
at location
if expression
expression
evaluates
to true.
Before you begin debugging, make sure that your program is saved and that the program and any files it calls exist on your search path or in the current folder.
To resume execution after a breakpoint pauses execution, use dbcont
or dbstep
. To exit debug mode, use
dbquit
. To remove all the
breakpoints in the file, use dbclear in
. To remove all breakpoints
in all files, use filename
dbclear all
. For more information, see
dbclear
.
MATLAB can become unresponsive when it pauses at a breakpoint while
displaying a modal dialog box or figure created by your program. To exit debug
mode and return to the MATLAB prompt (>>
), use
Ctrl+C.