如何用MATLAB拟合曲线来求参数?
2个回答
展开全部
令x=(cos(k)./sin(k))./c,这个就是xdata向量
y=252/(2.016129032*10^9)*a*x^b
取log得到
log(y)=b*log(x)+log(252/(2.016129032*10^9)*a)
所以log(y)与log(x)是线性关系,用p=polyfit(log(xdata),log(y),1)求出
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
%
因为log(252/(2.016129032*10^9)*a)=p(2)
所以最终程序是如下:
clear
all
c=[2.7,2.8,2.9,3,3.1,3.2,3.45,3.7,3.95,4.2,4.45,4.7,4.95,5.2];
k=[0,47,93,140,186,279,372,465,558,651];
y=[18.98,27.35,34.86,38.52,38.44,37.73,38.43,43.87,42.77,46.22];
xdata=(cos(k)./sin(k))./c;
p=polyfit(log(xdata),log(y),1);
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
y=252/(2.016129032*10^9)*a*x^b
取log得到
log(y)=b*log(x)+log(252/(2.016129032*10^9)*a)
所以log(y)与log(x)是线性关系,用p=polyfit(log(xdata),log(y),1)求出
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
%
因为log(252/(2.016129032*10^9)*a)=p(2)
所以最终程序是如下:
clear
all
c=[2.7,2.8,2.9,3,3.1,3.2,3.45,3.7,3.95,4.2,4.45,4.7,4.95,5.2];
k=[0,47,93,140,186,279,372,465,558,651];
y=[18.98,27.35,34.86,38.52,38.44,37.73,38.43,43.87,42.77,46.22];
xdata=(cos(k)./sin(k))./c;
p=polyfit(log(xdata),log(y),1);
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
展开全部
令x=(cos(k)./sin(k))./c,这个就是xdata向量
y=252/(2.016129032*10^9)*a*x^b
取log得到
log(y)=b*log(x)+log(252/(2.016129032*10^9)*a)
所以log(y)与log(x)是线性关系,用p=polyfit(log(xdata),log(y),1)求出
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
%
因为log(252/(2.016129032*10^9)*a)=p(2)
所以最终程序是如下:
clear
all
c=[2.7,2.8,2.9,3,3.1,3.2,3.45,3.7,3.95,4.2,4.45,4.7,4.95,5.2];
k=[0,47,93,140,186,279,372,465,558,651];
y=[18.98,27.35,34.86,38.52,38.44,37.73,38.43,43.87,42.77,46.22];
xdata=(cos(k)./sin(k))./c;
p=polyfit(log(xdata),log(y),1);
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
y=252/(2.016129032*10^9)*a*x^b
取log得到
log(y)=b*log(x)+log(252/(2.016129032*10^9)*a)
所以log(y)与log(x)是线性关系,用p=polyfit(log(xdata),log(y),1)求出
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
%
因为log(252/(2.016129032*10^9)*a)=p(2)
所以最终程序是如下:
clear
all
c=[2.7,2.8,2.9,3,3.1,3.2,3.45,3.7,3.95,4.2,4.45,4.7,4.95,5.2];
k=[0,47,93,140,186,279,372,465,558,651];
y=[18.98,27.35,34.86,38.52,38.44,37.73,38.43,43.87,42.77,46.22];
xdata=(cos(k)./sin(k))./c;
p=polyfit(log(xdata),log(y),1);
b=p(1);
a=exp(p(2))/252*(2.016129032*10^9);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询