作业帮 > 综合 > 作业

matlab,帮我看看这道题~

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/17 23:13:20
matlab,帮我看看这道题~
x=[1 11 21 31 41 51 61 71 81 91 101];
Lgx=[0 1.0414 1.3222 1.4914 1.6128 1.7076 1.7853 1.8513 1.9085 1.959 2.0043];
p=polyfit(x,Lgx,5);
fitx=1:0.1:101;
fity=polyval(p,fitx);
plot(x,Lgx,'ro');hold on;
plot(fitx,log(fitx)/log(10),'r-');
plot(fitx,fity,'k-');hold off;
再问: ����˵��ÿ����˼·��лл
再答: x=[1 11 21 31 41 51 61 71 81 91 101];Lgx=[0 1.0414 1.3222 1.4914 1.6128 1.7076 1.7853 1.8513 1.9085 1.959 2.0043];p=polyfit(x,Lgx,5);%��������Ϊ����ʽy=p(1)x^5+p(2)x^4+p(3)x^3+p(4)x^2+p(5)x+p(6) fitx=1:0.1:101;%��ɵȼ��0.1����1��101�ĺ��������fity=polyval(p,fitx);%�����ϵĶ���ʽ�ͺ�����������plot(x,Lgx,'ro');hold on;%��Ԫ���ɢ��plot(fitx,log(fitx)/log(10),'r-');%������lg(x)������plot(fitx,fity,'k-');hold off;%����϶���ʽ������