在MATLAB中,有一组数据,要画在双对数坐标上,并拟合成一条直线,然后把拟合后的直线表达式输出,怎么做到
x=[42816184669683868610101241066511941]y=[33.444542.084947.255251.058355.639258.38476...
x=[4281 6184 6696 8386 8610 10124 10665 11941]
y=[33.4445 42.0849 47.2552 51.0583 55.6392 58.3847 61.8866 64.3721]
有追加,急啊!!! 展开
y=[33.4445 42.0849 47.2552 51.0583 55.6392 58.3847 61.8866 64.3721]
有追加,急啊!!! 展开
1个回答
展开全部
x=[4281 6184 6696 8386 8610 10124 10665 11941];
y=[33.4445 42.0849 47.2552 51.0583 55.6392 58.3847 61.8866 64.3721];
x=log(x);y=log(y);
fun=inline('c(1)+c(2)*x','c','x');
c=lsqcurvefit(fun,[5,20],x,y),disp('logy=c(1)+c(2)*logx')
c = -1.8819 0.6465
syms logy logx
logy=vpa(c(1),5)+vpa(c(2),5)*logx
y=[33.4445 42.0849 47.2552 51.0583 55.6392 58.3847 61.8866 64.3721];
x=log(x);y=log(y);
fun=inline('c(1)+c(2)*x','c','x');
c=lsqcurvefit(fun,[5,20],x,y),disp('logy=c(1)+c(2)*logx')
c = -1.8819 0.6465
syms logy logx
logy=vpa(c(1),5)+vpa(c(2),5)*logx
更多追问追答
追问
那个C1没有算对啊
追答
对的,请你看一看给的数据有没有问题?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询