How to stop autosave when closing matlab

4 ビュー (過去 30 日間)
Henrik
Henrik 2014 年 7 月 25 日
コメント済み: Henrik 2014 年 7 月 27 日
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 Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by