Generate Random Sample between [0,1)
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi guys,
how do I generate a uniformly distributed random numbers between [0,1)?
"rand" can only generate (0,1).
Thanks,
Jonathan
댓글 수: 0
채택된 답변
Walter Roberson
2016년 1월 17일
With N an integer between 1 and 53 (inclusive)
randi([0 2^N-1])/(2^N)
provided that randi is truly uniform random.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!