function approximateMesh(n) % Plots the approximation of the mesh for t=-1..1 on x'=x^2 for tol=2^-n tol=2^-n; N=1/(4*tol); t1=-sqrt(1-(0:N)/N); t2=sqrt((1:N)/N); tapprox=[t1 t2]'; happrox=tapprox(2:length(tapprox))-tapprox(1:length(tapprox)-1); f=inline('t^2','t','x'); [t x n]=varStep(f,[-1,1],-1/3,tapprox(2)-tapprox(1),tol); h=t(2:length(t))-t(1:length(t)-1); plot(t(1:length(t)-1),h,'.'); hold on; plot(tapprox(1:length(tapprox)-1),happrox,'x'); title(strcat('Plot of Actual and Conjectured Mesh for \tau=',num2str(tol)) ); xlabel('t_i');ylabel('h_i');legend('Mesh From Algorithm','Mesh From Conjecture');hold off;