Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 2 Dez. 2020

0 Stimmen

r=rand+1
r = 1.5233

4 Kommentare

Wen Shu Wong
Wen Shu Wong am 2 Dez. 2020
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 am 2 Dez. 2020
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 am 2 Dez. 2020
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by