Save Open State in Editor???
Mostra commenti meno recenti
Is there no preferences option to have editor reload previous state w/o having to open each and every file again? Very rude behavior...
Risposte (1)
Steven Lord
il 17 Gen 2020
1 voto
In the Preferences for MATLAB, there's a section titled Editor/Debugger. One of the options that you can select (and I believe is selected by default) is "On restart reopen files from previous MATLAB session". However I believe under certain circumstances (like if MATLAB crashes) that may not always work.
Or do you mean you accidentally or intentionally closed a file (or all the files) and want to undo that action? I don't believe there is a way to undo that, but it seems like a reasonable enhancement request.
As a third option, if you want to be able to "remember" what files are opened, close some and/or open others, then restore the "remembered" set of files I think the projects functionality in MATLAB may be of interest to you. That functionality was introduced in release R2019a.
8 Commenti
Steven Lord
il 17 Gen 2020
So you were expecting if you executed
edit
at the MATLAB prompt with the Editor not open, it would open all the files that were open the last time and are still available rather than opening a new file? That's instead of (or in addition to) when you open MATLAB it opening the last session's files?
I think you should take a look at the projects functionality as I suspect that will be more in alignment with what you're expecting in terms of "persistence".
dpb
il 17 Gen 2020
Les Beckham
il 18 Gen 2020
I'm pretty sure that Matlab saves the editor configuration when Matlab itself is closed. If you close the editor while Matlab is still open you are basically telling Matlab "I'm done with this editor session and you can completely forget about it". If you close Matlab with an open editor session and then restart Matlab, the configuration of the editor will be restored as it was when you last closed Matlab. This seems relatively intuitive if you think of Matlab, and all of its associated windows as an IDE. When closed, the IDE configuration is saved, and when opened, it is restored.
I've used Matlab this way for years (I always have my editor session open when I close Matlab and it re-opens when I restart Matlab -- ready to pick up where I left off).
It sounds like you are concerned about having the editor open when closing Matlab because of a fear of losing possibly unsaved edits. I'm pretty sure that if you close with an unsaved edit you will be prompted to save or discard your changes.
Try it and see. Projects are a cool addition but, I think, aren't really relevant to your issue.
dpb
il 18 Gen 2020
Mac
il 9 Ott 2025
Would it also be possible to use the automatically saved list of open matlab files (for instance in Matlab2020a) to make a newer matlab version (for instance Matlab2024b) installed on a different computer (with the same file structure) open the same files?
(Or is there some other way to open a long-ish list of files (same file structure on computer) on another computer)
Categorie
Scopri di più su Environment and Settings in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!