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

 採用された回答

Walter Roberson
Walter Roberson 2016 年 1 月 17 日

0 投票

With N an integer between 1 and 53 (inclusive)
randi([0 2^N-1])/(2^N)
provided that randi is truly uniform random.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by