% Graphs to demonstrate the definition of limit. x=0:.005:2; y=(x+2).*(x+1).*(x-2).*x.^3+2-1; xl=x(1:198); xr=x(204:401); xrp=x(201:401); yl=y(1:198); yr=y(204:401); yrp=y(201:401); x0=1; y0=-5; subplot(2,2,1) p1=plot(x,y,'y'); axis([0 2 -15 5]) set(p1,'linewidth',3) grid set(gca,'XTick',[0 .5 1 1.5 2]) subplot(2,2,2) p2=plot(xl,yl,'r',xr,yr,'r'); axis([0 2 -15 5]) set(p2,'linewidth',3) grid set(gca,'XTick',[0 .5 1 1.5 2]) subplot(2,2,3) p3=plot(xl,yl,'c',x0,y0-4,'c.',xr,yr,'c'); axis([0 2 -15 5]) set(p3,'linew',3,'markersize',15) grid set(gca,'XTick',[0 .5 1 1.5 2]) subplot(2,2,4) p4=plot(xl,yl,'g',xrp,-yrp-12,'g'); axis([0 2 -15 5]) set(p4,'linew',3) grid set(gca,'XTick',[0 .5 1 1.5 2])