How to stop autosave when closing matlab

5 visualizzazioni (ultimi 30 giorni)
Henrik
Henrik il 25 Lug 2014
Commentato: Henrik il 27 Lug 2014
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?

Risposta accettata

Geoff Hayes
Geoff Hayes il 25 Lug 2014
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 Commento
Henrik
Henrik il 27 Lug 2014
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!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by