How to generate pseudo random number with fix range ?
이전 댓글 표시
Hello.
All I needs is a set of random numbers with the same mu but range between 1 to 9. No fix distribution No fix variance, just the same mu. So, I have try . . .
r=mu*rand([1 9],m,n);
m=30,500 and 1000, n=1
but it does not work T-T
Thankyou for all your kindness and help and I'm so sorry about my broken english ^_^
답변 (2개)
Geoff
2012년 3월 22일
1 개 추천
I've seen this kind of question asked before. Have a look at the solution here:
Wayne King
2012년 3월 21일
You can generate uniform random numbers between 1 and 9 with:
R = 1+8*rand(1000,1);
댓글 수: 3
Chanon
2012년 3월 21일
Wayne King
2012년 3월 21일
You are not going to get a random number generator to produce a sequence that follows some probability law that has the exact same mean each time unless you just generate the same sequence each time.
Oleg Komarov
2012년 3월 21일
Unless the number of trials becomes inf, which is another way of phrasing Wayne's statement.
카테고리
도움말 센터 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!