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 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