Respuesta aceptada

Cris LaPierre
Cris LaPierre el 2 de Dic. de 2020
r=rand+1
r = 1.5233

4 comentarios

Wen Shu Wong
Wen Shu Wong el 2 de Dic. de 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 el 2 de Dic. de 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 el 2 de Dic. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Centro de ayuda y File Exchange.

Preguntada:

el 2 de Dic. de 2020

Comentada:

el 2 de Dic. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by