function Orbit(fcn,x0,N,par)

%% This routine is taken from http://pages.pomona.edu/~aer04747/MatlabFiles.htm

% fcn is the name of the function, x0 is the starting
% value, N is the number of iterates, and par is the
% optional parameter vector.

if nargin < 4
    Y=iterates(fcn,x0,N);
else
    Y=iterates(fcn,x0,N,par);
end;

plot(0:1:N, Y,'b.',[-1 N+1],[0 0],'k',[0 0],[min(Y)-.1 max(Y)+.1],'k')
xlabel('ITERATE: i')
ylabel('ORBIT: x_i')
