User-defined termination script for MATLAB
finish
executes user-specified commands when exiting.
MATLAB® calls the finish.m
script, if defined, whenever you
do one of the following.
Click the close button on the MATLAB desktop on Microsoft®
Windows® platforms or the equivalent on UNIX® platforms.
Type quit
or exit
at the command
prompt.
If an error occurs in the finish
script, then
quit
is canceled so that you can correct your
finish.m
file without losing your workspace.