Quit debug mode
dbquit terminates debug mode. The Command Window then displays the
standard prompt (
>>). The file being executed is
not completed and no result is returned. All breakpoints
remain in effect.
If MATLAB® is in debug mode for more than one function,
dbquit only terminates debugging for the active function.
For example, if you debug
file1 and also debug
file2, then running
file1 remains in
debug mode until you run
dbquit again. However, if you debug
file3 and step into
file4, then running
dbquit terminates debugging for both file.
dbquit all ends debugging for all files
Create a file,
buggy.m, that contains
function z = buggy(x) n = length(x); z = (1:n)./x;
Create a second file,
contains these statements.
function z2 = buggy2(y) m = length(y); z2 = (1:m).*y;
Set breakpoints in
run both files. MATLAB pauses at the first line in
dbstop in buggy dbstop in buggy2 buggy(5) buggy2(5)
dbstack command to check the
In buggy2 (line 2) In buggy (line 2)
Quit debugging. MATLAB ends debugging for
buggy remains in debug mode.
In buggy (line 2)
dbquit again to exit debug mode
dbquit all ends debugging
for both files simultaneously.