% Playing with the Quadratic Family % Kevin Knuth % 17 April 2008 cVALUES = [0.25, 0, -3/4, -1, -2, -2.2]; for i = 1:length(cVALUES) c = cVALUES(i); x = -2:0.01:2; y = x.^2 + c; figure; hold on; plot(x,y) Bx = [2,2,-2,-2,2]; By = [2,-2,-2,2,2]; line(Bx,By) line([-2,2],[0,0],'color','k'); line([0,0],[-2,2],'color','k'); line([-2,2],[-2,2], 'color','r'); axis([-2,2,-2,2]) title(['C = ' num2str(c)]); end % %% for i = 1:length(cVALUES) c = cVALUES(i); x = -2:0.01:2; y = (x.^2 + c).^2 + c; figure; hold on; plot(x,y) Bx = [2,2,-2,-2,2]; By = [2,-2,-2,2,2]; line(Bx,By) line([-2,2],[0,0],'color','k'); line([0,0],[-2,2],'color','k'); line([-2,2],[-2,2], 'color','r'); axis([-2,2,-2,2]) title(['C = ' num2str(c)]); end %