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 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!