matlab指数函数拟合

帮个忙。x=[0.6, 0.7, 0.8, 0.88, 0.91, 1];
y=[0.83, 1, 1.34, 2.1, 3.1, 6.5]
拟合为指数函数。要表达式。

拟合函数表达式y=a*exp(b+cx)

式中a=0.06154920769, b=-3.18125203, c=7.822374803

拟合度0.9725(相关系数)

温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-05-22
clear all;
close all;
x=[10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5 40 42.5 45 47.5 50];
y=[62.1 77.3 92.5 104 112.9 121.9 125 129.4 134 138.2 142.3 143.2 144.6 147.2 147.8 149.1 150.9];
myfunc=inline('beta(1)+beta(2)*exp(beta(4)*x)+beta(3)*exp(-beta(4)*x)','beta','x');
beta=nlinfit(x,y,myfunc,[0.5 0.5 0.5 0.5]);
a=beta(1),k1=beta(2),k2=beta(3),m=beta(4)
xx=min(x):max(x);
yy=a+k1*exp(m*xx)+k2*exp(-m*xx);
plot(x,y,'o',xx,yy,'r')
相似回答