Using normrnd to generate a random sequence
조회 수: 10 (최근 30일)
이전 댓글 표시
I'm trying to use the function 'normrnd' to generate a zero-mean random sequence distributed uniformly between +/- 0.25. How do I go about doing this?
댓글 수: 0
채택된 답변
Roger Stafford
2018년 2월 12일
The best answer to your question is, “don’t use ‘normrnd’ for that purpose!” It is very much the wrong distribution for that.
You should use ‘rand’ as follows:
x = 0.5*rand(m,n)-0.25;
This will give you a statistically uniform distribution between -0.25 and +0.25, and nowhere else.
추가 답변 (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!