早教吧 育儿知识 作业答案 考试题库 百科 知识分享

指数函数的最小二乘法曲线拟合,非常急切,请教您数据为:x=[0.081.422.883.423.954.825.526.006.307.177.727.968.508.989.5310.0710.3210.7010.9511.2011.5011.9912.5313.1713.5713.8214.2214.3614.8615.5016.30

题目详情
指数函数的最小二乘法曲线拟合,非常急切,请教您
数据为:x=[0.08 1.42 2.88 3.42 3.95 4.82 5.52 6.00 6.30 7.17 7.72 7.96 8.50 8.98 9.53 10.07 10.32 10.70 10.95 11.20 11.50 11.99 12.53 13.17 13.57 13.82 14.22 14.36 14.86 15.50 16.30 16.83 17.33 17.83 18.38 18.88 19.17 19.42 19.82 20.07 20.31 20.61 20.86 21.36 21.90 22.40 22.95 23.44 23.70 23.99 24.25 24.50 24.99 25.53 25.78 26.33 26.82 27.73 28.27 28.77 29.81 30.11 30.59 31.14 31.65 32.19 33.49 33.97 34.52 35.17 35.92 36.71 36.96 37.76 38.56 39.71 40.35];
y=[0.08 1.23 3.45 4.69 5.76 7.65 8.96 10.20 10.77 12.58 13.65 14.23 14.72 15.87 16.78 17.68 18.09 18.75 19.16 19.57 19.98 20.81 21.55 22.53 23.19 23.52 24.01 24.18 25.00 25.82 26.89 27.55 28.37 29.11 29.77 30.43 30.67 31.17 31.58 31.91 32.24 32.40 32.73 33.39 33.96 34.38 35.12 35.77 36.02 36.35 36.51 36.92 37.34 37.83 38.08 38.65 38.98 39.80 40.38 40.63 41.45 41.53 42.02 42.27 42.60 42.85 43.50 43.75 44.00 44.24 44.74 44.82 44.90 44.98 44.98 44.90 43.59];
拟合函数为:y=k*(1-exp(-a*t))
▼优质解答
答案和解析
>> t=[0.08 1.42 2.88 3.42 3.95 4.82 5.52 6.00 6.30 7.17 7.72 7.96 8.50 8.98 9.53 10.07 10.32 10.70 10.95 11.20 11.50 11.99 12.53 13.17 13.57 13.82 14.22 14.36 14.86 15.50 16.30 16.83 17.33 17.83 18.38 18.88 19.17 19.42 19.82 20.07 20.31 20.61 20.86 21.36 21.90 22.40 22.95 23.44 23.70 23.99 24.25 24.50 24.99 25.53 25.78 26.33 26.82 27.73 28.27 28.77 29.81 30.11 30.59 31.14 31.65 32.19 33.49 33.97 34.52 35.17 35.92 36.71 36.96 37.76 38.56 39.71 40.35]';
y=[0.08 1.23 3.45 4.69 5.76 7.65 8.96 10.20 10.77 12.58 13.65 14.23 14.72 15.87 16.78 17.68 18.09 18.75 19.16 19.57 19.98 20.81 21.55 22.53 23.19 23.52 24.01 24.18 25.00 25.82 26.89 27.55 28.37 29.11 29.77 30.43 30.67 31.17 31.58 31.91 32.24 32.40 32.73 33.39 33.96 34.38 35.12 35.77 36.02 36.35 36.51 36.92 37.34 37.83 38.08 38.65 38.98 39.80 40.38 40.63 41.45 41.53 42.02 42.27 42.60 42.85 43.50 43.75 44.00 44.24 44.74 44.82 44.90 44.98 44.98 44.90 43.59]';
st= [0.5 0.5];
ft_ = fittype('k*(1-exp(-a*t))' ,...
'dependent',{'y'},'independent',{'t'},...
'coefficients',{'k','a'});
[curve,goodness]= fit(t,y,ft_,'Startpoint',st)
h= plot(cf_,'fit',0.95);
legend off; % turn off legend from plot method call
set(h,'Color',[1 0 0],...
'LineStyle','-','LineWidth',2,...
'Marker','none','MarkerSize',6);
hold on,plot(t,y,'*')
--------------------------------------------------------------------------------------------
curve =
General model:
curve(t) = k*(1-exp(-a*t))
Coefficients (with 95% confidence bounds):
k = 64.64 (61.65,67.63)
a = 0.03313 (0.03072,0.03554)
goodness =
sse:82.6613
rsquare:0.9931
dfe:75
adjrsquare:0.9930
rmse:1.0498