matlab 指数曲线拟合:y=112*[m*exp(b*t)+n*exp(c*t)
t=[5,6,7,8,9,10,11,12]y=[112,114.2,108.56,113.85,133.18,122.63,133.77,141.37]想求一下m,n,...
t=[5,6,7,8,9,10,11,12] y=[112,114.2,108.56,113.85,133.18,122.63,133.77,141.37]
想求一下 m,n,b,c的数值,谢谢!! 展开
想求一下 m,n,b,c的数值,谢谢!! 展开
2个回答
展开全部
>> t=[5,6,7,8,9,10,11,12]';y=[112,114.2,108.56,113.85,133.18,122.63,133.77,141.37]';
st_ = [0.4451919776251 0.8507909293692 0.266754247608 0.3393365455729 ];
ft_ = fittype('112*(m*exp(b*t)+n*exp(c*t))' ,...
'dependent',{'y'},'independent',{'t'},...
'coefficients',{'b', 'c', 'm', 'n'});
cf_ = fit(t,y,ft_ ,'Startpoint',st_)
cf_ =
General model:
cf_(t) = 112*(m*exp(b*t)+n*exp(c*t))
Coefficients (with 95% confidence bounds):
b = -0.862 (-7.933, 6.209)
c = 0.04737 (-0.02942, 0.1242)
m = 7.71 (-241.2, 256.6)
n = 0.7117 (0.1076, 1.316)
st_ = [0.4451919776251 0.8507909293692 0.266754247608 0.3393365455729 ];
ft_ = fittype('112*(m*exp(b*t)+n*exp(c*t))' ,...
'dependent',{'y'},'independent',{'t'},...
'coefficients',{'b', 'c', 'm', 'n'});
cf_ = fit(t,y,ft_ ,'Startpoint',st_)
cf_ =
General model:
cf_(t) = 112*(m*exp(b*t)+n*exp(c*t))
Coefficients (with 95% confidence bounds):
b = -0.862 (-7.933, 6.209)
c = 0.04737 (-0.02942, 0.1242)
m = 7.71 (-241.2, 256.6)
n = 0.7117 (0.1076, 1.316)
展开全部
function f=zhouxx(x,xdata)
f=112*(x(1)*exp(x(2)*xdata)+x(3)*exp(x(4)*xdata))
xdata=[5 6 7 8 9 10 11 12];
ydata=[112,114.2,108.56,113.85,133.18,122.63,133.77,141.37];
x0=[0 0 0 0];
x=curvefit('zhouxx',x0,xdata,ydata);
解得
x=[7.6930 -0.8615 0.7117 0.0474]
顺序分别为m,b,n,c的值。
注意这里使用了optimization toolbox(优化工具箱)中的curvefit,在国内应该都装了的吧,呵呵。
f=112*(x(1)*exp(x(2)*xdata)+x(3)*exp(x(4)*xdata))
xdata=[5 6 7 8 9 10 11 12];
ydata=[112,114.2,108.56,113.85,133.18,122.63,133.77,141.37];
x0=[0 0 0 0];
x=curvefit('zhouxx',x0,xdata,ydata);
解得
x=[7.6930 -0.8615 0.7117 0.0474]
顺序分别为m,b,n,c的值。
注意这里使用了optimization toolbox(优化工具箱)中的curvefit,在国内应该都装了的吧,呵呵。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询