pseudo random numbers using the linear congruent method
30 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kapil Gupta
am 4 Apr. 2020
Beantwortet: Rahul kumar
am 27 Okt. 2022
how can i plot scatter plot between x(i) and x(i-1)
like:
x(i) = (mod(a*x(i-1)+c,m))
where "a" and "c" are contant and "m" is mod
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 4 Apr. 2020
Try this
a = 37;
c = 91;
m = 10000;
x = zeros(1,10000);
x(1) = 7;
for i=2:numel(x)
x(i) = mod(a*x(i-1)+c,m);
end
X = x(1:end-1);
Y = x(2:end);
scatter(X,Y, '.');
0 Kommentare
Weitere Antworten (1)
Rahul kumar
am 27 Okt. 2022
a = 37;
c = 91;
m = 10000;
x = zeros(1,10000);
x(1) = 7;
for i=2:numel(x)
x(i) = mod(a*x(i-1)+c,m);
end
X = x(1:end-1);
Y = x(2:end);
scatter(X,Y, '.');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Visual Exploration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!