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,b,c的数值,
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 09:38:14
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,b,c的数值,
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,b,c的数值,
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,b,c的数值,
>> 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)
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];
...
全部展开
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,在国内应该都装了的吧,呵呵。
收起