dbstop
Set breakpoints for debugging
Syntax
dbstop in file
dbstop in file at location
dbstop in file if expression
dbstop in file at location if expression
dbstop if condition
dbstop(b)
Description
dbstop in
setsa 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 itis paused.
dbstop in
setsa breakpoint at the specified location. MATLAB execution pausesimmediately before that location, unless the location is an anonymous function.If the location is an anonymous function, then execution pauses justafter the breakpoint.file
at location
dbstop in
setsa conditional breakpoint at the first executable line of the file.Execution pauses only if file
if expression
expression
evaluates totrue (1)
.
dbstop in
setsa conditional breakpoint at the specified location. Execution pausesat or just before that location only if the file
at location
if expression
expression
evaluatesto true.
Examples
Input Arguments
More About
Tips
-
Before you begin debugging, make sure that your programis saved and that the program and any files it calls exist on yoursearch path or in the current folder.
-
To resume execution after a breakpoint pauses execution,use
dbcont
ordbstep
. To exit debug mode, usedbquit
. -
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.
参考: