x0=0.7; l=[]; skip=400; n=1000; for a=2.9:0.01:4 f = @(x) a.*x.*(1-x); df=@(x)a.*(1-2*x); x=[x0]; for k=1:n x=[x,f(x(end))]; end; figure(1) hold on plot(a.*ones(1,n-skip+1),x(skip+1:n+1),'r.','MarkerSize',0.5) l=[l,sum(log(abs(df(x(skip+1:n+1)))))/(n-skip+1)]; end figure(2) plot(2.9:0.01:4,l,'b-')