How to recover an unsaved "untitled2.m" script after computer crashed
393 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have been working in an unsaved "untitled2.m" script when my computer crashed.
When restarting matlab this unsaved document was gone along with the .asv files in my current directory.
However, when opening a new script I noticed that the new scripts filename is "untitled3.m", which means that somewhere the "untitled2.m" document must exist. The question is where? I assume this is some temporary folder created somewhere while matlab is still running. But how do I access this folder/file using Macbook.
0 Kommentare
Antworten (3)
Codey Nacke
am 2 Sep. 2024
I had a similar issue and was able to recover the code. I had an untitled file that I was working on and hadn't yet saved when my power went out. I was able to find the script in the temp folder.
First, navigate to where Matlab is storing temp files by running tempdir then navigating to that folder in your file system.
Next, I found a folder called "Editor_wtfiy" that had a file called "LiveEditorEvaluationHelperE1112034879.m" that had a copy of my code. I assume that the "E1112034879" is a unique identifier for each script.
TLDR: Look in ~tempdir~/Editor_wtfiy/LiveEditorEvaluationHelper[...].m
1 Kommentar
Walter Roberson
am 2 Mär. 2023
However, in practice that directory is used for MATLAB mostly to store files being built into a .slx or .xlsx, or code extracts when running LiveScript or running regular script section by section ("Run and Advance")
You could also look under ~/Library/'Application Support'/MathWorks/MATLAB but I don't think you will find anything useful there.
Time to invoke Time Machine.
2 Kommentare
Walter Roberson
am 3 Mär. 2023
The file name might hypothetically be handled by something recorded in prefdir .
I just tested on my system, creating some untitled files and deleting them all. The next file had the next sequence number. (At least within the same session; I did not test closing MATLAB.)
Praprara
am 16 Sep. 2024
Lol I came to this page 2 months ago for this same issue but since you hadn't commented, I wasn't been able to get back the file. But seeing this comment now, I finally know how to retrieve 'lost' matlab files. Thank you!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Entering Commands 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!