Disable autosave from ".m*"-file to ".m"-file before running a programm
Show older comments
Hello everyone,
I'm currently working on a program in the Editor. If I change something, the .m file changes to a .m* file in the Current Folder Section.
The moment I run the program, either using the "Run"-Button or the Command Window, the file is automatically changed to a .m file and all changes i applied in the editor are saved immediately.
I already disabled all autosaves in the "Preferences > Editor/Debugger > Backup Files" Section. However, the file still autosaves my changes.
Can someone help me to disable this annoying automatism?
Greets from Hamburg
Answers (3)
Steven Lord
on 15 Mar 2017
2 votes
Unset the "Automatic file changes" option for saving whenever you click away from the file in the Editor/Debugger section of the preferences for MATLAB. See this documentation page for more information.
1 Comment
Nathan Raynor
on 28 Sep 2018
Thank you for this. Somehow, a large portion of my code was deleted and when I clicked away from the file, it was saved. I did not notice until the next day, so any asv file was too recent to use as a backup. I managed to repair it referencing a prior version. Not sure if autosaving the original file like that should be a default setting.
Changing this can neither work nor beeing useful. The "*" in the header of the editor means, that the file was changed. Running it requires to save it at first. Anything else would lead to confusions or ambiguities: What would happen if you change the code during running? When a function is called, Matlab reads the current version from the hard disk, parses it and executes it. If your file is not saved before, you would run the previous version.
If this automatism is annoying for you, adjust your workflow. There is no way to get around this. You can select a block of code and run the selection, perhaps this is a workaround for you.
The autosave mechanism is something else. Before it was introduced I've lost a lot of work. Today e.g. Windows offers a method also to restore previous versions of the files. But having more backups is a good idea in every case.
Ron Scheffler
on 15 Mar 2017
0 votes
Categories
Find more on Share and Distribute Software in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!