% script file for functional iteration of the function % % f(x) = cx(1-x) c = input('enter the value of c ') xstart = input('enter the starting point x ') N = input('enter the number of iterations ') f = inline('c*x.*(1-x)', 'x', 'c'); xplot = linspace(0,1,201); plot(xplot, f(xplot,c), xplot, xplot) hold on x = zeros(1,N); x(1) = xstart; plot(x(1), 0, '*') plot(x(1), f(x(1),c), '*') disp('hit return to continue ') pause for n = 2:N x(n) = f(x(n-1),c); plot(x(n), 0, '*') plot(x(n), f(x(n),c), '*') disp('hit return to continue ') pause end hold off [x', f(x,c)']