Matlab代码变成不可读的符号 [英] matlab code turned into unreadable symbols

查看:87
本文介绍了Matlab代码变成不可读的符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Matlab中遇到了问题,我的代码被转换为无法读取的符号字符串(我怀疑这对cs人来说是一个简单的问题,但是我只是一个受过学术培训的最终"用户代码,也就是说,我几乎不懂理论,很不幸地,很容易忘记它.

I hit something wrong in Matlab and my code was transformed into unreadable strings of symbols (I . I suspect that this is a simple question for cs people, but I'm just an academic-in-training "end" user of code --that is, I know little theory and forget it easily, unfortunately.

我按了ctr + z,但是什么也没发生,将其关闭并再次打开,但是符号仍然存在.而且它没有运行,我得到的错误是:

I hit ctr+z but nothing happened, closed it and opened it again, but the symbols are still there. And it doesn't run, the error I get is:

The input character is not valid in MATLAB statements or expressions.

这是我的代码的开头,处于不幸的当前状态:

This is the beginning of my code, in its unfortunate current state:

MATLAB 5.0 MAT-file, Platform: PCWIN, Created on: Sun Oct 05 06:57:45 2014   
"‰\*’fTøÄ^L3:!I]ƒÁCƒÒP>朳÷>—º0ç²öEEHÉm�0fÈçRHñ)—\¢ßZï³æ3öïû£óû�㬽ֻÞËó>ïûîZ‡£ñ-IŽj⻺ø«âÀ§ªú}ÕeßrÏè¼Qƒ3råó$G]µ¾O<ÈÎÉÊÈÍÊLuTø¨Õ4»ÕÁãò²ÇºFå–¯fØ   P«iv«•8\¶\¶\¶œ¶œ¶œ¶Ff�¿â¼XuåÚ­Š½•¥bï•«yÙ¹Cs®��ÕÊ»áßüJ»ËWÓìV+Ù‘a' |5Ínµ²#\¶\¶\¶œ¶œ¶œ¶»†Ére9+F4±šVyU:£ÂæËVÓl$T¸0±÷òe…ɬ�9C]W 5kPNîØœ¼Ê«9¹ƒ+{'3ÍVBš­„´Jœ¶:8mupÚêà´ÕÁi«ƒÓV‡r~¨("¾ZAD|µ‚ˆr.±•�f+¡’¶~È°õC†­2lý�aë‡[?äåŒØx)'«8mVÓ*¯–ƒÓn5Í‘3nÐy¡<›—ýòÃùt[ùj†Ü_®°WI«¼·|YüGâ9ËåpT´‚V³s._% 7–¯VÜèPHÍ•72{„+?g°Ê/§íê{Sm÷¦&"_YD†­Ü+÷¦Úí%¹µÄ_IUG¼NVSv"×Éñw­õСþo‰‡E³Ä§ÐÍfæ&|ÓÈÍ©Y¥•ÞÆÍ°ëÏK‹×¿ô5°GÞзÃ�SØ„"Ýö/`mågf›ºê�;ŸÝÃÄéocÇÜ,µú‡
Ÿíçeƒ;îíáfr9c¯ú^¨ãûðöb§;ÞÙ^À¤ØÅǦ°‡÷ç§,Ø<…�¾°müá nöû{ÅÝÛ•zØCþ‡Îo×éÙ@gÿ;ãæc:ô[b2yÍÛ­¼L~åz<ìÏ>æ†|^ÜÓÃ=Oélžg¦8¿ØÄú~�­müIÞ°Ÿuæù­÷²FKöþ‰Òžr3if>÷²æÕ&¿™þ"¿‡ºÙŒ›"žªu£Îž•60Ù$)p Áî�†76`ŠÉÆÉ�õ|¬‰?í°ÎÞJ†4ÑÙù~XÖHܸS‡ß�?ÙdŠä‚d?ä&ûØ´£µû—°¯™ú
ѯ�:¯TUç5/îo ôxÄÇd8ëž1¿ûMè]ÕùOûÙßó…À]Ûô�ø,3Øöñ‡[¤ÞkÂîÛMÄ;ÉÇ—
ÏòÅqñŠØV½­q)ð±Û¤³Lx§õ¢sä1ß½ÎÝjÀn¦ä§XëE‘ãï}ågÌüágâß6?ô3¹\œ„�%>vR˜}C®ñ;釜b?»(àÒâ—

以此类推.

谢谢!

推荐答案

您的文件根本不是代码,它是Matlab数据文件,扩展名错误.您可以通过运行来查看

Your file isn't code at all, it's a Matlab data file with the wrong extension. You can see this by running

>> x = magic(10);        %// creates a 10x10 matrix
>> save('junk.m', 'x');  %// note .m extension rather than .mat
>> edit junk.m

您将在编辑器窗口中看到类似的内容-

You will see something like this in your editor window -

MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Sun Oct 05 14:21:38 2014
å³B1#V A6å³B1#V å³B1#V // etc etc, lots more junk here

.mat文件的扩展名更改为.m并以代码形式打开时的外观.

which is what a .mat file looks like when you change its extension to .m and open it as code.

因此,可悲的是,我认为您已经用一些数据覆盖了代码文件.如果您将文件重命名为.mat扩展名,然后将其加载到MATLAB中,则可以查看数据是什么.

So, sadly, I think you have overwritten your code file with some data. If you rename your file to have a .mat extension and then load it in MATLAB, you will be able to see what the data is.

如果您有某种备份,则可以找回代码.否则,你很不走运.

If you have some kind of backup, you may be able to get your code back. Otherwise you're out of luck.

P.S.我过去也曾经是只是一个受过学术训练的代码最终用户".我花了一些时间学习CS的理论和编程语言(在一年的时间里不断变化),它回报了100倍的生产率提高.您不仅可以自己解决更多的问题,而且还可以做您甚至认为无法实现工作自动化的工作,从而为有趣"的研究留出了更多时间.我强烈建议您投入时间!

P.S. I used to be "just an academic-in-training end-user of code" as well. I spent some time learning a little bit of CS theory and programming languages (on and off over the course of a year) and it has paid back 100x in productivity gains. Not only will you be able to solve many more issues on your own, you'll also be able to do things that you haven't even considered possible to automate your work, leaving more time for the "fun" bit of research. I highly recommend the time investment!

这篇关于Matlab代码变成不可读的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆