Disable autosave from ".m*"-file to ".m"-file before running a programm

11 Ansichten (letzte 30 Tage)
Ron Scheffler
Ron Scheffler am 15 Mär. 2017
Kommentiert: Nathan Raynor am 28 Sep. 2018
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

Antworten (3)

Steven Lord
Steven Lord am 15 Mär. 2017
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 Kommentar
Nathan Raynor
Nathan Raynor am 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.

Melden Sie sich an, um zu kommentieren.


Jan
Jan am 15 Mär. 2017
Bearbeitet: Jan am 15 Mär. 2017
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
Ron Scheffler am 15 Mär. 2017
I meant, that the new (edited) program is run. I remember from my university, that you always had to save the program manually first in order to run it. Otherwise the old program (without the changes) would be run. I would prefer these settings but I am not sure where to do so.

Kategorien

Mehr zu Workspace Variables and MAT Files finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by