dbquit - Quit debug mode - MATLAB (original) (raw)

Main Content

Syntax

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 debugfile2, then running dbquit terminates debugging for file2, while file1 remains in debug mode until you run dbquit again. However, if you debugfile3 and step into file4, then runningdbquit terminates debugging for both file.

dbquit can only be called from the command line.

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.

Run buggy2.

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.

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

Call dbquit from the command line to quit debugging. MATLAB ends debugging for buggy2, whilebuggy remains in debug mode.

Call dbquit again to exit debug mode forbuggy.

Alternatively, dbquit all ends debugging for both files simultaneously.

Tips

Version History

Introduced before R2006a