How can I restore files previously opened in Editor using MATLAB_Editor_State.xml?

16 views (last 30 days)
My Matlab 2012a crashed and the MATLABDesktop.xml.prev was cleared so I can't restore. I had a number of files opened in the Matlab Editor and would like to restore this. I see that there is a MATLAB_Editor_State.xml file available that contains all previously opened files. How can I easily restore this? Of course, I can write a script myself that loops through this list and open every single one of the file in the list but I was hoping there is a more simple way to do this. Can someone help?

Answers (1)

Sudhanshu Bhatt
Sudhanshu Bhatt on 26 Oct 2015
Edited: Sudhanshu Bhatt on 26 Oct 2015
Hello Jeffery,
I understand that you want to restore previously open files from the MALTAB_Editor_State.xml.
Unfortunately, as of now the only way to do this is to read the XML file and fetch the names of the files. You can do this by looping through the XML file as you have mentioned in the question description.
" xmlread" function in MATLAB can be used to read an XML file. More information on the "xmlread" function can be found in the documentation link below:
If MATLABDesktop.xml.prev still contains the previous editor state, then the below web page explains on how to restore the editor state:
If the files have been deleted, then the below web page from Microsoft could be helpful in recovering lost or deleted files:
Sudhanshu Bhatt


Find more on Desktop 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!