Quit debug mode


dbquit all


dbquit terminates debug mode. The Command Window then displays the standard prompt (>>). The file being processed is not completed and no results are returned. All breakpoints remain in effect, unless your file contains (and MATLAB® has processed) one or more of the following commands: clear all, clear function, clear classes.

If you debug file1 and step into file2, running dbquit terminates debugging for both files. However, if you debug file3 and also debug file4, running dbquit terminates debugging for file4, but file3 remains in debug mode until you run dbquit again.

dbquit('all') or the command form, dbquit all, ends debugging for all files at once.


This example illustrates the use of dbquit relative to dbquit('all'). Set breakpoints in and run file1 and file2:

>>	dbstop in file1
>>	dbstop in file2
>>	file1
K>>	file2
K>>	dbstack
MATLAB software returns

K>>	dbstack
		In file1 at 11
		In file2 at 22

If you use the dbquit syntax

K>>	dbquit

MATLAB ends debugging for file2 but file1 is still in debug mode as shown here

K>> dbstack
	  	in file1 at 11

Run dbquit again to exit debug mode for file1.

Alternatively, dbquit('all') ends debugging for both files at once:

K>>	dbstack
		In file1 at 11
		In file2 at 22

returns no result.

Related Examples

Introduced before R2006a

Was this topic helpful?