for i=1:500 H=10/i h1=H*rand(1) h2=H*rand(1) h=max(h1,h2) d2u_h=.... d2u_exac=.... err=abs(d2u_h-d2u_exac) ..... end |
T=log10(n) % n is the number of the intervals [c,d]=polyfit(T,log10(err_lvl),1) % err_lvl is the array of errors set(axes,'fontsize',18) hold on plot(T,log10(err_lvl),'s'); err_fit=c(1)*T+c(2); plot(T,err_fit); xlabel('-log_{10} N'); ylabel('log_{10} err'); hold off |
Grades will be based upon: Homework and in-class participation
top