Many web browsers allow to undo close tab:
Is it possible to undo close tab in Matlab's editor?
I use R2014a on Windows 7.
It isn't officially supported in MATLAB, but with reference to Undocumented MATLAB, there is a workaround.
MATLAB stores its Desktop windows state in a file called MATLABDesktop.xml
that is located in the user’s prefdir
(preference directory) folder. You can echo where this is in MATLAB by simply typing in prefdir
in the Command Prompt and pushing Enter or RETURN. As you are also using Windows, you can also do this to open up the folder within MATLAB:
winopen(prefdir);
This should open up a new Windows Explorer window that will directly bring you to the prefdir
folder.
This file includes information about the position and state of every Desktop window. Since the editor files are considered Desktop documents, they are also included in this file. As such, when you close the editor, these documents are simply removed from the MATLABDesktop.xml
file.
It turns out that MATLAB automatically stores a backup version of this file in another file called MATLABDesktop.xml.prev
, in the same prefdir
folder. I'm also using MATLAB R2014a in Windows 7 and I have double-checked to see if these files are also on my system and they are!
So before doing anything else, close MATLAB, delete the latest MATLABDesktop.xml
file, replace it with a copy of the MATLABDesktop.xml.prev
file, renaming it to MATLABDesktop.xml
. After, restart MATLAB and the editor should reopen with your previous tabs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With