function coblogiplot2s(initn,r) % This function plots logistic growth for a population with initial size initn, % and growth rate r for its iterations and plots the result on a "cobweb" graph. % This plots the behaviour after the transients have died out. n(1) = initn; for i = 1:1000 n(i+1) = logist2(n(i),r); s(2*i-1) = n(i); t(2*i-1) = n(i+1); s(2*i) = n(i+1); t(2*i) = n(i+1); end %plot([1:its+1],n,'.') %plot(s(800:1000),t(800:1000)) plot(s,t) hold on plot([0 1],[0,1]) x=linspace(0,1,50); y=r*x.*(1-x); plot(x,y)