I am not getting unique random numbers from henon map??please help in this

1 回表示 (過去 30 日間)
my code is here
if true
% code
N=16;
a=1.4;
b=0.3;
x=zeros(1,N);
y=zeros(1,N);
x(1)=0.63154*(10^(-11));
y(1)=0.18906*(10^(-11));
for i=1:N
x(i+1)=1+y(i)-a*((x(i))^2);
y(i+1)=b*x(i);
end
plot(x,y)
for j=0:(N/2)-1
q(2*j+1)=x(j+1);
q(2*j+2)=y(j+1);
end
d=floor(q*(10^15));
s=mod(d,N);
end

採用された回答

the cyclist
the cyclist 2017 年 12 月 19 日
編集済み: the cyclist 2017 年 12 月 19 日

Are you sure you have a problem with your code? I increased N to 16000, and plotted your data. It sure looks like a Hénon attractor to me.

  4 件のコメント
the cyclist
the cyclist 2017 年 12 月 19 日
Can you add some more detail? I don't understand why you expect non-repeating values in s, so it is not possible for me to help you.
Are you trying to produce pseudorandom numbers from the Hénon map? (Numbers if pseudorandom sequences can repeat. Just not in a predictable way, ideally.)
Do you have some reference? Are you trying replicate some results from a paper or a textbook?
It might be that your code is mathematically correct, but there are nuances with doing floating point math.
VINAY KUMAR SHARMA
VINAY KUMAR SHARMA 2017 年 12 月 20 日
I want to scramble the pixels of an image, by generating random numbers from henon map, I want to create indexing. if i have repeating values I cant decrypt image again.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by