尝试在 GNU/octave 中绘图时出现以下错误:
octave:22> plot(b(:,2),b(:,4))
error: invalid conversion from real matrix to real scalar
error: __calc_dimensions__: expecting graphics handle as only argument
error: called from:
error: /usr/share/octave/3.6.2/m/plot/private/__go_draw_axes__.m at line 55, column 8
error: /usr/share/octave/3.6.2/m/plot/private/__go_draw_figure__.m at line 167, column 19
error: /usr/share/octave/3.6.2/m/plot/__gnuplot_drawnow__.m at line 86, column 5
octave:23>
变量b从csv文件加载,如下所示:
b=csvread("my.csv")
my.csv的内容
1,40.0942,0.775539,18.658
2,40.1882,0.857556,415.677
3,40.2818,0.858294,233.934
4,40.3748,0.887273,348.503
5,40.4669,0.908618,27.0149
6,40.558,0.908496,234.81
7,40.6478,0.911826,58.3943
8,40.7362,0.922848,204.128
9,40.823,0.928547,7.75615
10,40.908,0.920065,0.0654867
可悲的是,有时会发生错误,而其他错误则不会。(八度错误?)
有谁知道发生了什么?
顺便说一下,我的系统是:Ubuntu 12.11,octave 3.6.2,Linux kernel 3.5.00-22-generic
编辑:
我认为这是一个错误。上述错误是由plotyy之后调用的情节引起的。要重现错误,请执行以下命令:
1> b=csvread("my.csv");
2> plot(b(:,2),b(:,4))
3> plotyy(b(:,1),b(:,2),b(:,1),b(:,4))
4> plot(b(:,2),b(:,4))