This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Quit debug mode


dbquit all



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.

dbquit all ends debugging for all files simultaneously.


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 and run both files. MATLAB pauses at the first line in buggy and buggy2.

dbstop in buggy
dbstop in buggy2

Call the dbstack command to check the debugging status.

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

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

In buggy (line 2)

Run dbquit again to exit debug mode for buggy.

Alternatively, dbquit all ends debugging for both files simultaneously.

Introduced before R2006a

Was this topic helpful?