How can I generate a random real numbers from a specific range?
조회 수: 19 (최근 30일)
이전 댓글 표시
Hi all,
I want to pick real numbers randomly from a specific range (0 , 0.2304). Can any one help me to do that?
Thank you
댓글 수: 1
채택된 답변
Azzi Abdelmalek
2014년 9월 13일
편집: Azzi Abdelmalek
2014년 9월 13일
rand*0.2304
For a general case (a,b)
a=0.12
b=0.45
out=a+(b-a)*rand;
댓글 수: 2
Image Analyst
2014년 9월 14일
편집: Image Analyst
2014년 9월 14일
out4decimalPlaces = round(out * 10000)/10000
Please mark Azzi's answer as Accepted now.
추가 답변 (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!