Can't understand what rng(seed) does.
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have come across this command in matlab. rng(seed). I used the help to understand what its means, and I still don't get it. Can anyone help me understand what it does?
rng Control the random number generator used by RAND, RANDI, and RANDN.
rng(SD) seeds the random number generator using the non-negative
integer SD so that RAND, RANDI, and RANDN produce a predictable
sequence of numbers.
THanks.
0 Kommentare
Antworten (1)
the cyclist
am 20 Apr. 2015
Bearbeitet: the cyclist
am 20 Apr. 2015
This page from stackoverflow may also help.
2 Kommentare
the cyclist
am 20 Apr. 2015
Yes. You can think of the pseudorandom numbers from the generator as a long -- very long -- list of numbers that are uncorrelated with each other, and the seed determines where in that list you start.
Siehe auch
Kategorien
Mehr zu Random Number Generation 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!