This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Quit debug mode




dbquit terminates debug mode. The Command Window then displays the standard prompt (>>). The file being executed is not completed and no results are 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, 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, 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.

Related Examples

Introduced before R2006a

Was this topic helpful?