1 使用m文件,程序见附件
调用方式及结果:
X=[1 2 3 4 5 6]; Y=[0.07049 0.14229 0.287221 0.287221 0.14229 0.07049];
>> [fitresult, gof] = createFit_v1(X, Y)
fitresult =
General model:
fitresult(x) = a*exp(-((x-L/2)/b)^2)
Coefficients (with 95% confidence bounds):
L = 7 (6.436, 7.564)
a = 0.3008 (0.2456, 0.3559)
b = -1.89 (-2.302, -1.478)
gof =
sse: 0.0014
rsquare: 0.9713
dfe: 3
adjrsquare: 0.9522
rmse: 0.0216
2,直接使用cftool工具箱