%产生假数据
x=1:0.5:30;
x=x';
y=0.7*exp(0.33*x)+100*rand(length(x),1);
%拟合
p=fittype('a*exp(b*x)')
f=fit(x,y,p)
x=1:0.5:30;
x=x';
y=0.7*exp(0.33*x)+100*rand(length(x),1);
%拟合
p=fittype('a*exp(b*x)')
f=fit(x,y,p)
plot(f,x,y);
%-----------------------------------以下是f的结果
f =
General model:
f(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 0.8088 (0.759, 0.8587)
b = 0.3252 (0.323, 0.3273)