- function F = fun(x, xdata)
- F= 2 * ( exp ( x(1) * x(2) * xdata ./ 2.0 ) - 1 ) ./ ( x(1) * xdata );
复制代码
- xdata = [0.3:0.1:4.5];
- ydata = [2060.,2140.,2240.,2340.,2440.,2490.,2550.,2630.,2720.,2800.,2880.,2940.,3010.,3080.,3140.,3200.,3240.,3280.,3330.,3380.,3420.,3460.,3510.,3550.,3600.,3640.,3680.,3720.,3750.,3800.,3850.,3900.,3940.,3980.,4020.,4060.,4110.,4150.,4180.,4210.,4230.,4250.,4280.];
- x0 =[.2e-3, 2000]'; % Starting guess
- [betafit,r,J]=nlinfit(xdata,ydata,'fun',x0)
复制代码
betafit =
1.0e+003 *
0.000000219796786
2.379747492551644 |