MATLAB: Iteration chaotique

logistic map

hello i need a matlab code that can be able to give me us output positiv intgers from that are included in[1,128] for X and Y but [1,28] for Z , i have this chaotic code but i can't arrive to put a candition that give positiv integers from this intervals:
X=8; K=50; % X: la clé, K: Nombre d’itérations
for i=1:K
X=4*X*(1-X); % itération de la Carte logistique
Y=4*X*(1-X);
Z=4*Y*(1-Y);
end
Please help me if you can.Thanks

Best Answer

Run this function with start value for X in the interval (0,1).
function cssm()
X=0.5325; K=100; % X: la clé, K: Nombre d’itérations
figure
plot3( 1, 1, 1 )
hold on
plot3( -1, -1, -1 )
for i=1:K
X=4*X*(1-X); % itération de la Carte logistique
Y=4*X*(1-X);
Z=4*Y*(1-Y);
% fprintf( '%15f%15f%15f\n', X, Y, Z )
plot3( X, Y, Z, 'd' )
pause( 0.02 )
end
end