function nlfm(X,y,beta0)
beta = nlinfit(X,y,@modle,beta0)
function yy=modle(beta0,X)
[M,N]=size(X);
beta1=repmat(beta0,M,1);
z=beta1.*X;
yy=sum(z,2);
在命令行,定义X,y,beta0后键入:
>> nlfm(X,y,beta0)
Warning: The Jacobian at the solution is ill-conditioned, and some
model parameters may not be estimated well (they are not identifiable).
Use caution in making predictions.
> In nlinfit at 246
In nlfm at 15
beta =
-0.8743 -0.1995 -0.2952 0.2455 -0.1000
[ 本帖最后由 花如月 于 2007-7-22 17:58 编辑 ] |