- 积分
- 23
- 注册时间
- 2010-11-7
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2014-3-30 00:05:17
|
显示全部楼层
来自 北京
data:- Dat=[1100.21 57.66 1.8
- 1157.88 57.79 1.7
- 1272.85 58.03 1.67
- 1330.34 58.22 1.67
- 1389 57.69 1.7
- 1590 57.01 1.67
- 1820 55.42 1.6
- 2049 59.35 1.5
- 2308 58.32 1.56
- 2596 57.28 1.6
- 2711 57.13 1.368
- 2826 55.61 1.33
- 2883 54.79 1.315
- 2940 53.78 1.325
- 3001 54.41 1.3
- 3117 55.93 1.2495
- 3291 57.15 1.28
- 3377 58.05 1.25
- 3522 58.41 1.31
- 3725 57.61 1.31
- 3899 53.55 1.195
- 4015 51.22 1.178
- 4188 50.89 1.185]
复制代码 fit- g = fittype( @(a, b,m, n,p, x,y) a.*(x.^m./y.^n)+b.*y.^p,...
- 'independent', {'x', 'y'},'dependent', 'z' )
- [fitobject,gof] = fit( Dat(:,1:2),Dat(:,3), g);
- plot(fitobject, Dat(:,1:2),Dat(:,3))
- errors = feval(fitobject,Dat(:,1:2))-Dat(:,3)
复制代码 lsqcurvefit- f = @(x, xdata ) x(1).*(xdata(:,1).^x(3)./xdata(:,2).^x(4))+x(2).*xdata(:,2).^x(5)
- [beta,resnorm,residual,exitflag,output,lambda,jacobian]= lsqcurvefit(f,rand(5,1), Dat(:,1:2), Dat(:,3));
复制代码 nlinfit- f = @(beta, xdata ) beta(1).*(xdata(:,1).^beta(3)./xdata(:,2).^beta(4))+beta(2).*xdata(:,2).^beta(5)
- [beta,R,J,CovB,MSE,ErrorModelInfo] = nlinfit(Dat(:,1:2),Dat(:,3),f,rand(5,1) )
复制代码 |
|