How to stop autosave when closing matlab

4 vues (au cours des 30 derniers jours)
Henrik
Henrik le 25 Juil 2014
Commenté : Henrik le 27 Juil 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?

Réponse acceptée

Geoff Hayes
Geoff Hayes le 25 Juil 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 commentaire
Henrik
Henrik le 27 Juil 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!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by