误差曲线(Matlab)

1 loglog(dof(1:21),errorestimate(1:21),'--^',dof1(1:24),errorestimate1(2:25),'r*--','MarkerSize',8);hold on;
2 loglog(dof(1:21),eigvalue(1:21)-[13.0863416259350;],'kO-','MarkerSize',8);%[13.0863323929054;][13.0863322295266;]
3 loglog(dof1(1:24-2),eigvalue1(1:24-2)-[13.0863416259350;],'+-','MarkerSize',8,'Color',[.8 0 0]);
4 xlabel('degree of freedom','fontsize',12);ylabel('error of the first eigenvalue','fontsize',12);
5 a=regress(log10(errorestimate(1:21)),[ones(21,1) log10(dof(1:21))]);
6 x=linspace(dof(1),max(dof1));y=10.^(a(1)+0.5)*x.^a(2);hold on; loglog(x,y,'m--')
7 legend('error indicator for Algorithm 4.1','error indicator for Algorithm 4.2','true error for Algorithm 4.1','true error for Algorithm 4.2',...
8     strcat('a line with slope=',num2str(a(2))),1);axis tight;
Error curve

 

原文地址:https://www.cnblogs.com/wangshixi12/p/6104684.html