How to stop autosave when closing matlab

4 次查看(过去 30 天)
Whenever I close matlab it saves the current workspace as matlab.mat. I do not want this, but cannot find a way to turn automatic saving it off. Help?

采纳的回答

Geoff Hayes
Geoff Hayes 2014-7-25
Are you using a termination file when MATLAB exits? At the link finish, it discusses how when the MATLAB® program quits, it runs a script called finish.m. If you have this file, then it may be that it has a line of code that is automatically saving the workspace to the matlab.mat file.
From this same link, it does mention sample termination files that come with MATLAB. In my Command Window, I typed
open finishsav.m
and in the MATLAB editor, the following code appeared
disp(getString(message('MATLAB:finishsav:SavingWorkspaceData')));
save
The above doesn't run, but if the same code exists in the finish.m script then it is these two lines that you will want to comment out.
In your command window, type
which finish
and observe the results. If you see
'finish' not found.
then this script is not defined and it is unclear (to me!) how the workspace data is automatically being saved. However, if you observe the path to this file, then just open it in the editor
open finish
and observe the contents. Comment out any code that you don't wish to run on termination of MATLAB.
Hope that this helps!
  1 个评论
Henrik
Henrik 2014-7-27
Thank you very much. I indeed had a finish.m file in a directory of functions that I got from someone else, and editing it solved my problem. Hooray!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by