function bifhi(ni,x0)

% Diagrama de bifurcacao,(no interacoes, x inicial)

if nargin<1 ni=200; end
if nargin<2 x0=.55; end

im(2001,8000)=0;
for col=1:8000
    mi=3+col/8000
    x=x0;
    for i=1:ni
        x=mi*x*(1-x);
        lin=round(x*2000);
        im(2001-lin,col)=im(2001-lin,col)+1;
    end
    im(:,col)=im(:,col)/max(im(:,col));
end
imwrite(im,'bif-hi.bmp');
