Matlab 2014a deletes M files in actual directory when exit

Hi,
Matlab 2014a deletes M files which are stored in actual directory when Matlab is exit.
Do you know why and how I can fix this?
Thanks in advance.
Best regards, Helmuth

7 commentaires

See if there is a finish.m file in the working directory or anywhere on matlabpath
which finish
should do the trick.
If it's not there, I don't know of any other reason for it; if it's happening (and I'm not saying it's not) report to official support at www.mathworks.com
Hi,
thanks for your reply.
>> which finish
'finish' not found.
Best regards, Helmuth
Hi,
normally I exit Matlab with the "X" at right upper edge of Matlab window. M files got deleted with this.
I exit Matlab with "quit" command in Matlab command window - the M files are not deleted with this.
When I exit Matlab now with the "X" again, the M files seem not to be deleted anymore.
Strange and scary ... probably there was some strange command cashed somewhere?
Best regards, Helmuth
Seems more than strange...were they open in an edit session and had an unexpected termination or something? Otherwise, it's hard to envision what could have happened unless there were some eval with 'del *.m' as its execution string or the like...
Hi, no files were open in an edit session when Matlab was exit.
Best regards, Helmuth
The problem of deleting files occurs now also on MDL files. It seems to occur randomly, probably when the MDL file was created with an older version of Matlab / Simulink?
As part of your finish.m file, two items you could consider are:
  • movefile to copy your files to a back-up directory (and perhaps doing that again in reverse in your startup.m file)
  • savepath to save your entire search path so it is created automatically at startup the next time you launch MATLAB.
This same problem came up in the last two or three weeks, but I don’t know what the fix was (if one was found) or if the details were similar to yours.

Connectez-vous pour commenter.

Réponses (4)

Andreas Goser
Andreas Goser le 13 Oct 2014
Modifié(e) : Andreas Goser le 13 Oct 2014
There is a bug report now available for this issue.
Image Analyst
Image Analyst le 10 Août 2014
Modifié(e) : Image Analyst le 10 Août 2014
It doesn't do that for me. What version are you using (official, trial, educational, or student)? What operating system? What is the folder name? If you bring up a window looking at the files (like Windows Explorer), and you see the files there, then when you close MATLAB, do all those files vanish? Do they appear in the recycle bin? Do you have a finish.m file that automatically gets run when MATLAB shuts down that might perhaps delete everything?

1 commentaire

Hi,
thanks for your reply.
Your questions:
> What version are you using (official, trial, educational, or student)?
Matlab 2014a Home Use.
> What operating system?
Windows 8.1
> What is the folder name
D:\hbosch\Matlab
> If you bring up a window looking at the files (like Windows Explorer), and you see the files there, then when you close MATLAB, do all those files vanish?
Yes.
> Do they appear in the recycle bin?
No.
> Do you have a finish.m file that automatically gets run when MATLAB shuts down that might perhaps delete everything?
No. I do not have this. A finish.m or similar does not exist.
Best regards, Helmuth

Connectez-vous pour commenter.

Jan
Jan le 10 Août 2014
Beside finish.m other functions are evaluated automatically when a Matlab session is finished:
  • CloseRequestFcn of figures, which might be invisible and hidden
  • mexAtExit functions define in Mex files
  • The StopFcn of audioplayer objects (in some Matlab versions, but seemed to caused a crash)

2 commentaires

Thanks for your reply. I open Matlab and close it directly after the system is ready. After closing, some files in my working directory are gone.
A finish.m files makes sense now to backup all files in the actual directory to somewhere else.
You should not have to do that. I suggest you call the Mathworks to track down that very unexpected behavior, if you can ever get it to repeat again.

Connectez-vous pour commenter.

Max
Max le 15 Avr 2015
Modifié(e) : Max le 15 Avr 2015
Any updates on this? I am experiencing the exact same issue with Matlab 2014b except I use Windows 7 Professional.
Edit: Nevermind, found the fix:

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Tags

Aucun tag saisi pour le moment.

Question posée :

le 10 Août 2014

Modifié(e) :

Max
le 15 Avr 2015

Community Treasure Hunt

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

Start Hunting!

Translated by