% plot the convergence rates from neumannbceg.m Smax=5; N=zeros(1,Smax); e1=N; e2=N; for s=1:Smax s N(s)=2^(s+4); [e1(s),e2(s)]=neumannbceg(N(s)); end figure(3) loglog(N,e1,'bx-',N,e2,'rx-',N,1./N.^2,'g','LineWidth',2) xlabel('N'), ylabel('Error in u(x,0.25)') legend('error in numerical solution with ghost point','error in numerical solution','O(\Delta x^2)')