rand command give different answer
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
why this rand command give different result
1 Commento
Stephen23
il 9 Feb 2020
"why this rand command give different result"
What do you expect its output to be?
Risposte (2)
James Tursa
il 9 Feb 2020
Modificato: James Tursa
il 9 Feb 2020
rand( ) is a random number generator ... it is supposed to give a different result.
doc rand
If you want to start over with the same stream of numbers you will need to re-seed it.
1 Commento
Chuguang Pan
il 9 Feb 2020
All the random number functions, rand, randn, randi, and randperm, draw values from a shared random number generator. Every time you start MATLAB, the generator resets itself to the same state.
The rand function draw values from a RandStream.
0 Commenti
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!