zhangpu
2009-05-26, 23:43
我按照书上写出的程序,总是有错误,就是找不出来,希望大哥大姐帮忙解答。谢谢!
function myplot(x,y)
x0=x(1);xe=x(end);
max_y=max(y);min_y=min(y);dy=(max_y-min_y)/10;
plot(x,y,'linewidth',2);grid;
axis([x0,xe,min_y-dy,max_y+dy])
set(gca,'FontSize',8)
出错为:
??? Input argument "x" is undefined.
Error in ==> myplot2 at 2
x0=x(1);xe=x(end);
不甚感激。
function myplot(x,y)
x0=x(1);xe=x(end);
max_y=max(y);min_y=min(y);dy=(max_y-min_y)/10;
plot(x,y,'linewidth',2);grid;
axis([x0,xe,min_y-dy,max_y+dy])
set(gca,'FontSize',8)
出错为:
??? Input argument "x" is undefined.
Error in ==> myplot2 at 2
x0=x(1);xe=x(end);
不甚感激。