u_p=0.2;
N=500;
figure(1)
clf;
r=2.9:0.001:3.9;
wyn=zeros(length(r), N);
j=1;
for r_ten=r
    for i=1:N
        u=fun(u_p,r_ten);
        x=r_ten;
        u_p=u;
    end
    for i=1:N
        wyn(j,i)=fun(u_p,r_ten);
        u_p=wyn(j,i);
    end
    j=j+1;

end

plot(r,wyn,'.','MarkerSize',1);
 
 
