Development Environment | ![]() ![]() |
Quitting MATLAB
To quit MATLAB at any time, do one of the following:
quit
at the Command Window prompt.Running a Script When Quitting MATLAB
When MATLAB quits, it runs the script finish
.m
, if finish.m
exists in the current directory or anywhere on the MATLAB search path. You create the file finish.m
. It contains functions to run when MATLAB terminates, such as saving the workspace or displaying a confirmation dialog box. There are two sample files in $matlabroot\toolbox\local
that you can use as the basis for your own finish.m
file:
finishsav.m
- Includes a save
function so the workspace is saved to a MAT-file when MATLAB quits.finishdlg.m
- Displays a confirmation dialog box that allows you to cancel quitting.![]() | Reducing Startup Time with Toolbox Path Caching | Using the Desktop | ![]() |