MATLAB Answers

Save Open State in Editor???

조회 수: 8(최근 30일)
dpb
dpb 17 Jan 2020
댓글: dpb 18 Jan 2020
Is there no preferences option to have editor reload previous state w/o having to open each and every file again? Very rude behavior...

  댓글 수: 0

로그인 to comment.

답변(1개)

Steven Lord
Steven Lord 17 Jan 2020
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.

  댓글 수: 6

표시 이전 댓글 수: 3
dpb
dpb 17 Jan 2020
" That's instead of (or in addition to) when you open MATLAB it opening the last session's files?"
Yes, precisely. By habit I never intentionally exit ML w/ the editor still open--that just seems too risky for my taste with source code file(s) still in the editor buffer(s). Hence, at least for me the action on restart is virtually always a "do nothing" one and I restart the editor inside the session.
I'll have to explore the project stuff, but I'm strongly suspecting it's not going to be what I would prefer for this purpose; I'm not trying to build a project which I'm guessing is what will be required--I just want what I had when I quit back unless I specifically say I want something different.
I guess I'm so ingrained with 30+ years habit with a specific toolset that I'm just where I presume that's the way everybody works! :)
Les Beckham
Les Beckham 18 Jan 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
dpb 18 Jan 2020
"t sounds like you are concerned about having the editor open when closing Matlab because of a fear of losing possibly unsaved edits"
I'm more concerned about the files themselves than an edit or two...if it's reliable to ensure never an open/dangling handle.
I suppose if one is used to just leaving the editor open and can prevent the reflex action of closing it (take a lot of retraining for a very old dog on that one :) ) that would end up similarly-behaving.
Agree projects as typically defined in IDEs is not what am looking for at all.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그

제품


Translated by