Matlab code was changed to some weird encryption when saved: Can I somehow revert this change?
이전 댓글 표시
I saved some homework I had been working on in class to my dropbox, and when I got home to look at it, the code appears to have been "encrypted", or something strange caused the code to completely change. The first line of code reads
"MATLAB 5.0 MAT-file, Platform: GLNX86, Created on: Wed Jan 19 21:35:37 2005"
at the top of my script, which seems to be the clue as to what happened here. The rest of the script is just a bunch of nonsense. For example a few lines of code read
¿„ð@@Â}=_¾Y@@íuA„*Z@¶í²'^¬Z@šSǶB[@Gþ«Cì[@§C‡cS@¬s\O§†G@ëd½Ðò×5@ Çóˆ<[+Y@×ÓÁHY@Ÿ™™™™ùX@×ÓÁHY@Çóˆ<[+Y@Ê[;‘*êP@
¿„ð@@
¿„ð@@Â}=_¾Y@@íuA„*Z@¶í²'^¬Z@šSǶB[@Gþ«Cì[@§C‡cS@¬s\O§†G@ëd½Ðò×5@ Ê[;‘*êP@Çóˆ<[+Y@×ÓÁHY@Ÿ™™™™ùX@×ÓÁHY@Çóˆ<[+Y@Ê[;‘*êP@
I'm not sure how this happened. It was obviously unintentional, and I would like to know if there is a way to reverse whatever happened here.
Note that I was working on a school computer, so retrieving history in matlab won't work as the computers "forget" everything after logging off. So any other suggestions are appreciated. Otherwise I'm going to have to redo several days of works :(
답변 (2개)
Walter Roberson
2015년 12월 10일
0 개 추천
Unfortunately, instead of copying your .m file, you used "save". "save" saves a copy of the current workspace to the named file. If you take the file and "load" it then you might see something useful in it, but probably your source is not there and is possibly not recoverable (it would depend on how the school computer is configured.)
댓글 수: 2
Stephen23
2015년 12월 10일
Andrew's "Answer" moved here:
Hmmm. Yea, load didn't work. Oh well, thanks for replying.
Walter Roberson
2015년 12월 10일
load('YourFileName.m', '-mat')
With the .m filename it would assume text, but -mat forces it to examine it as a save file.
Andreas Goser
2015년 12월 10일
0 개 추천
You may have an auto saved ASV file of your code
카테고리
도움말 센터 및 File Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!