Generate Random Sample between [0,1)

Hi guys,
how do I generate a uniformly distributed random numbers between [0,1)?
"rand" can only generate (0,1).
Thanks,
Jonathan

 Respuesta aceptada

Walter Roberson
Walter Roberson el 17 de En. de 2016
With N an integer between 1 and 53 (inclusive)
randi([0 2^N-1])/(2^N)
provided that randi is truly uniform random.

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de En. de 2016

Respondida:

el 17 de En. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by