%Matlab code for Exercise 1(e,f), page 67 (Devaney's text) %Change the code below for 1(e,f). It is set up to see 1(e). % To see 1(f), comment out line 10 (percentage sign in front), % remove the comment from line 9 (delete the percent sign). If you want a % plot of the second iterate, change y1 to y2 in line 17 (plot command): % %cvals=0:-0.05:-1.5; %Parameter range for 1(f) cvals=0:0.05:1.5; %Parameter range for 1(e) N=length(cvals); %Number of plots in the animation x=linspace(-2,2,200); %Domain of the plot- the interval from -2 to 2 for j=1:N y1=cvals(j)*sin(x); y2=cvals(j)*sin(y1); %Second composition, if desired plot(x,x,x,y1); %Change the last entry to y1, y2 % These correspond to F, F^2, F^3, F^4 axis([-2,2,-2,2]); fprintf('c value is %f \n',cvals(j)) pause end