Main Content

dbquit

Quit debug mode

Description

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 dbquit terminates debugging for file2, while 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.

example

dbquit all ends debugging for all files simultaneously.

Examples

collapse all

Create a file, buggy.m, that contains these statements.

function z = buggy(x)
n = length(x);
z = (1:n)/x';

Create a second file, buggy2.m, that contains these statements.

function z2 = buggy2(y)
m = length(y);
z2 = (1:m)*y;

Set breakpoints in buggy and buggy2.

dbstop in buggy
dbstop in buggy2

Run buggy. MATLAB pauses at the first line in buggy.

buggy(5)

Run buggy2.

buggy2(5)

MATLAB pauses at the first line in buggy2 and is still paused at the first line of buggy.

Call the dbstack command to check the debugging status.

dbstack
In buggy2 (line 2)
In buggy (line 2)

Quit debugging. MATLAB ends debugging for buggy2, while buggy remains in debug mode.

dbquit
dbstack
In buggy (line 2)

Run dbquit again to exit debug mode for buggy.

Alternatively, dbquit all ends debugging for both files simultaneously.

Version History

Introduced before R2006a