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=3062)

嘟嘟06 2008-05-16 08:45

[求助]程序出错
 
这有个简单的程序,运行时老是出错,自己始终找不着原因,有哪位高手可以帮助一下呀,谢谢了,程序内容是:function yhat=volum(beta,x)
yhat=beta(1)*exp(beta(2)./x);
x=2:16;
y=[6.42 8.20 9.58 9.5 9.7 10 9.93 9.99 10.49 10.59 10.60 10.80 10.60
10.90 10.76];
beta(0)=[8 2]';
[beta,r,J]=nlinfit(x',y','volum',beta0);
beta
出现的错误信息是:??? Input argument 'beta' is undefined.

Error in ==> C:\MATLAB6p5\work\volum.m
On line 2 ==> yhat=beta(1)*exp(beta(2)./x);
很需要指点呀!!

zickep 2008-05-16 12:15

未定义! 定义一下就行!


所有时间均为北京时间。现在的时间是 06:12

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