close file and quit debugger

Hi all,
Normally I code with "dbstop if error" enabled. Sometimes I type something which I know is an error (like forgetting to specify an input) in which I would rather the debugger not get enabled.
When encountering the error Matlab will open the file in question and place the cursor at the start of line.
I would like to write a function which closes the document in question and then quits the debugger.
I wrote some code to do this but when I run dbquit, the closed document opens again. Any suggestions on how to get around what I assume is a bug?
active_doc = matlab.desktop.editor.getActive;
active_doc.close();
%Bug ????
evalin('caller','dbquit');
%dbquit;
Thanks, Jim

Answers (0)

Asked:

on 29 May 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!