%Script file to show A_1, A_2, A_3 (Intervals that leave I=[-2,2]) % after 1 iteration, 2 iterations, 3 iterations. In these pictures, we % will set c=-3 c=-2.3; x=linspace(-3,3,500); b1=linspace(-2,2,500); b2=ones(size(b1)); y1=b1.^2+c; plot(x,x,'k',b1,-2*b2,'b',b1,2*b2,'b',2*b2,b1,'b',-2*b2,b1,'b',b1,y1,'r'); x1=b1.^2+c; idx1=find(abs(x1)>2); hold on plot(b1(idx1),b1(idx1),'g*'); hold off pause b2=b1; b2(idx1)=[]; x1=b2.^2+c; x1=x1.^2+c; idx1=find(abs(x1)>2); hold on plot(b2(idx1),b2(idx1),'m*'); hold off pause b3=b2; b3(idx1)=[]; x1=b3.^2+c; x1=x1.^2+c; x1=x1.^2+c; idx1=find(abs(x1)>2); hold on plot(b3(idx1),b3(idx1),'b*'); hold off pause b4=b3; b4(idx1)=[]; x1=b4.^2+c; x1=x1.^2+c; x1=x1.^2+c; x1=x1.^2+c; idx1=find(abs(x1)>2); hold on plot(b4(idx1),b4(idx1),'r.'); hold off