function bifurc(fun,mubegin,muend)

%   BIFURC(FUN,MUBEGIN,MUEND) plots a bifurcation diagram from MUBEGIN to
%   MUEND of the given FDE function FUN 

%   Copyright 2003
%   Centre for Nonlinear Dynamics in Physiology and Medicine

step=(muend-mubegin)/100;
y=[];x=[];
for i=1:100
ynew=fditer(fun,0.5343,mubegin+step*i,100);
xnew=(mubegin+step*i)*ones(1,50);
ynew=ynew(51:100);
y=[y; ynew];
x=[x; xnew'];
end;

plot(x,y,'.');
xlabel('mu');
ylabel('x');

if strcmp(fun,'quadmap')
title('bifurcation diagram of quadratic map');
elseif strcmp(fun,'sinemap')
title('bifurcation diagram of sine map')
elseif strcmp(fun,'tentmap')
title('bifurcation diagram of tent map')
end 
