MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   有一个算法不知道怎么写,报错,请大虾帮看看,谢谢! (https://www.labfans.com/bbs/showthread.php?t=4914)

basicx 2008-10-19 19:09

有一个算法不知道怎么写,报错,请大虾帮看看,谢谢!
 
>> f=@(x)('(60000+4x)./(5200+x)');
>> ezplot(f);
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.

Error in ==> specgraph\private\ezplotfeval>applyfun at 81
z(i) = feval(f,x(i));

Error in ==> specgraph\private\ezplotfeval at 68
z = applyfun(x);

Error in ==> ezplot>ezplot1 at 433
[y,f,loopflag] = ezplotfeval(f,x);

Error in ==> ezplot at 140
[hp,cax] = ezplot1(cax,f{1},vars,labels,args{:});

meteora1005 2008-10-19 21:50

回复: 有一个算法不知道怎么写,报错,请大虾帮看看,谢谢!
 
呵呵,你定义匿名函数f时错了,应该这样:
f=@(x)((60000+4*x)./(5200+x));
不用加单引号,4和x间要加乘号


所有时间均为北京时间。现在的时间是 11:14

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.