Control random number generation
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I have a question about the rng(seed) (random number generator) function. I have a code with which I call several functions in which random numbers are generated. In these functions is also used the seed that I defined in the main file?
Thanks in advance.
0 Commenti
Risposta accettata
Rik
il 28 Mag 2021
Slightly depending on what you mean: yes.
The random number generation has a global state, so it doesn't matter if the call is nested in a function or not.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Random Number Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!