求MATLAB 拟合指数函数的代码~
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/06/25 00:09:01
求MATLAB 拟合指数函数的代码~
x=[50 150 250 350 450 550 650]
y=[0.658415842 0.193069307 0.080858086 0.044554455 0.01650165 0.00330033 0.00330033]
想要拟合成y=a*exp(b*x)的形式~
x=[50 150 250 350 450 550 650]
y=[0.658415842 0.193069307 0.080858086 0.044554455 0.01650165 0.00330033 0.00330033]
想要拟合成y=a*exp(b*x)的形式~
![求MATLAB 拟合指数函数的代码~](/uploads/image/z/7936429-13-9.jpg?t=%E6%B1%82MATLAB+%E6%8B%9F%E5%90%88%E6%8C%87%E6%95%B0%E5%87%BD%E6%95%B0%E7%9A%84%E4%BB%A3%E7%A0%81%7E)
x=[50 150 250 350 450 550 650]';
y=[0.658415842 0.193069307 0.080858086 0.044554455 0.01650165 0.00330033 0.00330033]';
st_ = [7 -5.e-005 ];
ft_ = fittype('a*exp(b*x)',...
'dependent',{'y'},'independent',{'x'},...
'coefficients',{'a', 'b'});
cf_ = fit(x,y,ft_,'Startpoint',st_)
plot(cf_,'fit',0.95);hold on,plot(x,y,'*')
cf_ =
General model:
cf_(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 1.157 (1.03, 1.284)
b = -0.01137 (-0.01292, -0.009823)
![](http://img.wesiedu.com/upload/a/10/a10d83a13dedadf7d6f781272ffcf96f.jpg)
y=[0.658415842 0.193069307 0.080858086 0.044554455 0.01650165 0.00330033 0.00330033]';
st_ = [7 -5.e-005 ];
ft_ = fittype('a*exp(b*x)',...
'dependent',{'y'},'independent',{'x'},...
'coefficients',{'a', 'b'});
cf_ = fit(x,y,ft_,'Startpoint',st_)
plot(cf_,'fit',0.95);hold on,plot(x,y,'*')
cf_ =
General model:
cf_(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 1.157 (1.03, 1.284)
b = -0.01137 (-0.01292, -0.009823)
![](http://img.wesiedu.com/upload/a/10/a10d83a13dedadf7d6f781272ffcf96f.jpg)