Why do I get identical outputs from a randomized script?
Ältere Kommentare anzeigen
Hi all,
I am working on writing a script to simulate the random motion and decay of particles (random-walk). However, despite the fact that I call:
rng('shuffle');
at the beginnning of the script (after I call the function w/ input arguments), I have been getting the exact same output vectors from different/separate runs. rand and exprnd are both called within the script.
Should I make this the first line of the script instead? Or has anyone else had issues with this?
1 Kommentar
Destiny Ellenor
am 28 Okt. 2020
Antworten (1)
Peter Perkins
am 19 Nov. 2020
0 Stimmen
You don't want to use seeds to get independent parallel random number streams. Switch to using one of the generators that is designed for parallel random number generation, and use separate streams or substreams.
Kategorien
Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!