MATLAB Function Reference Previous page   Next Page
quit

Terminate MATLAB

Graphical Interface

As an alternative to the quit function, use the Close box or select Exit MATLAB from the File menu in the MATLAB desktop.

Syntax

Description

quit terminates MATLAB after running finish.m, if 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. For example, you can display a dialog box to confirm quitting using a finish.m file--see the following examples for details. 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 cancel is for use in finish.m and cancels quitting. It has no effect anywhere else.

quit force bypasses finish.m and terminates MATLAB. Use this to override finish.m, for example, if an errant finish.m will not let you quit.

Remarks

When using Handle Graphics in finish.m, use uiwait, waitfor, or drawnow so that figures are visible. See the reference pages for these functions for more information.

See Also

exit, finish

Examples

Two sample 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.

See Also
finish, save, startup


Previous page  questdlg quiver Next page

© 1994-2005 The MathWorks, Inc.