5. Logístico caótico

printf("Logistico caótico\n");
n=5;
k=2;
t=20;
r=15;
x=zeros(64,1);
tp=(0:t-1);
Nt=zeros(t,1);
for j=1:t
  Nt(j)=n;
  Nt;
tablero=zeros(64,1);
t2=zeros(64,1);
  for i=1:n
    x=randi(64);
    tablero(x)=tablero(x)+1;
endfor
  s=tablero;
for i=1:64
    if (s(i)<k)
        t2(i)=s(i)*r;
  end
  if (s(i)==k)
        t2(i)=s(i)*1;
    end
end
if (t2(i)==0)
  t2(1)=1;
end
pasan=sum(t2);
n=pasan;
endfor
plot(tp,Nt)
xlabel ("t");
ylabel ("Nt");
title ("Crecimiento logistico Caótico Nt vs pt");
t_vs_Nt=[tp',Nt]