how to create an array of size (x by y ) of normally distributed numbers having a range [a , b]
조회 수: 1 (최근 30일)
이전 댓글 표시
x = randi(20,5,7)
This randi func is used for uniformly distributed numbers. And for normally distributed numbers randn should be used.
But the randn func only takes the dimensions of the array which we want to create. I am a beginner. So I am stuck in the very basics.
Also I do not have mean and standard deviation values.
채택된 답변
David Hill
2020년 4월 12일
If you have the mean and standard deviation, then:
sd = 5;
mu = 500;
X = sd.*randn([x,y]) + mu;
댓글 수: 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!