채택된 답변

Cris LaPierre
Cris LaPierre 2020년 12월 2일

0 개 추천

r=rand+1
r = 1.5233

댓글 수: 4

Wen Shu Wong
Wen Shu Wong 2020년 12월 2일
Thank you so much. How about 50 random decimal values between 1.00 to 93.00?
The rand function creates random numbers from 0 to 1. See the documentation for more on specifying how many random numbers to create.
For your range, first create random numbers from 0-92 by multiplying the result by 92, then get it to go from 1-93 by adding 1.
r=rand(1,50)*92+1
r = 1×50
61.4748 9.3132 7.0734 80.1252 85.7785 54.4886 77.8041 22.8412 7.9122 36.5785 57.5735 9.9305 4.6449 38.0174 65.9258 76.0907 27.8438 55.9229 15.8530 1.9715 23.0542 4.4628 81.8775 27.8905 18.6223 74.1600 7.5745 3.2764 82.6740 54.1398
Wen Shu Wong
Wen Shu Wong 2020년 12월 2일
Thank you. Is it possible to create a left skewed distribution from the distribution above? I can't seem to find any resources on this.
Cris LaPierre
Cris LaPierre 2020년 12월 2일
rand creates a uniform distribution. You might look into the pearsrnd function, as that lets you define your distribution by setting the mean, standard deviation, skewness and kurtosis.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

질문:

2020년 12월 2일

댓글:

2020년 12월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by