查看完整版本 : [MATLAB基础] 【画图遇到的奇怪现象】
最近重装了下系统,matlab 是 2008b 以前一直没遇到这种情况,但是这次重装后出现了这种很奇怪的问题
我画了个很简单的图
比如 x=1:10000; plot(x,sin(0.001*x))
得到图后,我用编辑功能修改x轴坐标的范围的时侯就会出现下面图中错误
试过几次后发现x轴的数值如图中写成50,000这种三位数字加个逗号的形式的时候就会出错
如果直接修改成50000这种没有逗号的形式就不会出错,但是麻烦的是matlab默认的是50,000 这种形式的,就算改成50000没有逗号的,一回车matlab就还是变成50,000有逗号的形式的。然后就会出错。
另一台电脑上我也装了同一版本的matlab 默认的是50000这种没有逗号的形式,所以不会出错。同一个matlab装出来的怎么会不一样。 已经重装了好几次,没有解决。
还请各位高手帮忙看看,是不是有什么地方可以设置一下的。
另外一个机器上的 正常的matlab 2008b 的数值是没有逗号形式的 直接是 50000
laosam280
2009-04-12, 14:46
比如这样的一个句子,x=1:10,000;运行的结果等价于x=1:10(没有分号)
所以在写程序的时候要注意,尽量不要用逗号,你在输入数据的时候逗号占了内存的。
比如这样的一个句子,x=1:10,000;运行的结果等价于x=1:10(没有分号)
所以在写程序的时候要注意,尽量不要用逗号,你在输入数据的时候逗号占了内存的。
我写程序的时候没有写成x=1:10,000这样有逗号的,只是我画好图 编辑图片的坐标轴的时候 比如 xlimits 本来应该是 0 to 50000的, 现在成了 0 to 50,000这种有逗号的格式了 我把它改成没有逗号的形式但一回车matlab又把它变成了有逗号的形式,然后就会有错误提示了。
终于搞定了 这是2008b的一个bug 可以这样修复
2. At the command prompt type: matlabroot. This displays the path to MATLAB root. Write down the path.
3. Exit MATLAB
4. Navigate to the matlab root directory and then to java directory within it.
5. If there is no directory called patch under the java directory, create one there.
6. Navigate to the directory called patch
7. Create the following directory under the patch directory : com\mathworks\page\plottool\propertyeditor\controls (on Windows) or com/mathworks/page/plottool/propertyeditor/controls (on Unix and Mac)
8. Copy the following three files (attached) to the newly created controls directory:
LimitsControl$1.class
LimitsControl$TextControlTransferHandler.class
LimitsControl.class
9. Restart MATLAB.
希望以后碰到的可以不用像我这样重装好多遍还是没用了
vBulletin® v3.8.3,版权所有 ©2000-2025,Jelsoft Enterprises Ltd.