Generate Random Sample between [0,1)
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jonathan
le 17 Jan 2016
Réponse apportée : Walter Roberson
le 17 Jan 2016
Hi guys,
how do I generate a uniformly distributed random numbers between [0,1)?
"rand" can only generate (0,1).
Thanks,
Jonathan
0 commentaires
Réponse acceptée
Walter Roberson
le 17 Jan 2016
With N an integer between 1 and 53 (inclusive)
randi([0 2^N-1])/(2^N)
provided that randi is truly uniform random.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Random Number Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!