matlab的问题 已知一组数据 我想将曲线拟合成y=alnx+b 怎么编写matlab语句 还是说工具箱里有对数拟合函数
数据x=[0,70,130,210,337,578,776,1012,1142,1462,1841];y=[0,57,78,103,135,182,214,244,256...
数据
x=[0,70,130,210,337,578,776,1012,1142,1462,1841];
y=[0,57,78,103,135,182,214,244,256,272,275];
我用多项式拟合效果不好 求高手指教 展开
x=[0,70,130,210,337,578,776,1012,1142,1462,1841];
y=[0,57,78,103,135,182,214,244,256,272,275];
我用多项式拟合效果不好 求高手指教 展开
1个回答
展开全部
%y=alnx+b这个模型x至少要大于0把,我把你的第一个数据删了
x=[70,130,210,337,578,776,1012,1142,1462,1841];
y=[57,78,103,135,182,214,244,256,272,275];
plot(x,y,'o')
hold on
f=@(A,x)A(1)*log(x)+A(2);
A=nlinfit(x,y,f,[1,1])%%%方程系数矩阵
xx=min(x):0.1:max(x);
yy=A(1)*log(xx)+A(2);%%%方程形式
plot(xx,yy)
x=[70,130,210,337,578,776,1012,1142,1462,1841];
y=[57,78,103,135,182,214,244,256,272,275];
plot(x,y,'o')
hold on
f=@(A,x)A(1)*log(x)+A(2);
A=nlinfit(x,y,f,[1,1])%%%方程系数矩阵
xx=min(x):0.1:max(x);
yy=A(1)*log(xx)+A(2);%%%方程形式
plot(xx,yy)
追问
a=74.7442 b= -282.2831?
追答
对
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询