matlab finish函数语法

发表matlab finish函数相关文章
一句话说明: Termination file for MATLAB program

finish

Termination file for MATLAB program

Description

When the MATLAB® program quits, it runs a script called finish.m, if the script exists and is on the search path MATLAB uses or in the current directory. This is a file you create yourself that instructs MATLAB to perform any final tasks just prior to terminating. For example, you might want to save the data in your workspace to a MAT-file before MATLAB exits.

finish.m is invoked whenever you do one of the following:

  • Click the Close box in the MATLAB desktop on Microsoft® Windows® platforms or the equivalent on UNIX®[1] platforms

  • Type quit or exit at the Command Window prompt

Examples

Two sample termination files are provided with MATLAB in matlabroot/toolbox/local.

  • finishsav.m — Saves the workspace to a MAT-file when MATLAB quits.

  • finishdlg.m — Displays a dialog allowing you to cancel quitting and saves the workspace. See also the Confirmation Dialogs Preferences and the option for exiting MATLAB.

To create a termination file, make a copy of one of these sample files, changing the name to finish.m, and add it to the path to use it. You can modify the file to include any operations you want the termination file to perform.

More About

Tips

When using Handle Graphics® features 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

| |


[1] UNIX is a registered trademark of The Open Group in the United States and other countries.

欢迎转载,转载请注明来自一手册:http://yishouce.com/matlab/func/finish

与matlab finish用法相关的文章

友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1