|MATLAB Function Reference|
As an alternative to the
quit function, use the close box or select Exit MATLAB from the File menu in the MATLAB desktop.
terminates MATLAB after running
finish.m exists. The workspace is not automatically saved by
quit. To save the workspace or perform other actions when quitting, create a
finish.m file to perform those actions. If an error occurs while
finish.m is running,
quit is canceled so that you can correct your
finish.m file without losing your workspace.
quit is for use in
finish.m and cancels quitting. It has no effect anywhere else.
finish.m and terminates MATLAB. Use this to override
finish.m, for example, if an errant
finish.m will not let you quit.
When using Handle Graphics in
drawnow so that figures are visible. See the reference pages for these functions for more information.
finish.m files are included with MATLAB. Use them to help you create your own
finish.m, or rename one of the files to
finish.m to use it.
finishsav.m--Saves the workspace to a MAT-file when MATLAB quits.
finishdlg.m--Displays a dialog allowing you to cancel quitting; it uses
quit canceland contains the following code: