本人做非线性回归
M文件是
type hougen function yhat=hougen(beta,x)
b1 = beta(1);
b2 = beta(2);
b3 = beta(3);
b4 = beta(4);
b5 = beta(5);
b6 = beta(6);
b7 = beta(7);
b8 = beta(8);
x1 = x(:,1);
x2 = x(:,2);
x3 = x(:,3);
yhat = b1+b2*x1+b3*x2+(b4+b5*x1+b6*x2)./(1+exp(b7*(x3-b8)));
然后命令窗口输入
y;
>> x;
>> beta=[0.5,1,1,1,1,1,100,0.001];
>> betahat=nlinfit(x,y,@hougen,beta)
最后显示??? Error using ==> nlinfit
The model function 'hougen' generated the following error:
Function 'eval' is not defined for values of class 'double'.
这是什么原因啊?