Matlab 当然是可以的
xdata=[50 100 150 400 800];
ydata=[0.797595 0.754736 0.718371 0.555379 0.411674];
[z,gof] = fit(xdata.',ydata.', @(b, c, f, x) (1-f)*exp(-b*x)+f*exp(-c*x), ...
'StartPoint', [0.001, 0.001, rand], ...
'Lower', [0, 0, 0], ...
'Upper', [Inf, Inf, 1])
plot(xdata,ydata,'b-',xdata,z(xdata),'r-')
legend('data','fit')
z =
General model:
z(x) = (1-f)*exp(-b*x)+f*exp(-c*x)
Coefficients (with 95% confidence bounds):
b = 0.0008864 (0.0006362, 0.001137)
c = 0.04651 (-0.05451, 0.1475)
f = 0.1836 (0.1099, 0.2573)
gof =
sse: 4.4622e-04
rsquare: 0.9957
dfe: 2
adjrsquare: 0.9913
rmse: 0.0149
[attach]124464[/attach]