Gaussian distribution with randn
Mostrar comentarios más antiguos
Is it possible and how can i obtain a Gaussian distribution with randn for
mean= 0.126
and it varies by+- 0.02, max=0.146 and min=0.106,
to generate 1300 random values.
2 comentarios
Rik
el 14 de Nov. de 2017
Have you read the documentation (just type doc randn)? You'll need to shift the mean, change the width of the distribution and do something about values outside your range. Think carefully about the order in which you do these.
Joseph Lee
el 14 de Nov. de 2017
Respuesta aceptada
Más respuestas (1)
By definition, a gaussian distribution covers the whole range [-∞, +∞]. If your distribution has a min and max it's not gaussian anymore.
Furthermore, a gaussian distribution is defined by a mean and a standard deviation, not a mean and a range. If a gaussian distribution has a standard deviation of 0.02, you'll still find about 32% of the samples outside of that ±0.02 range.
1 comentario
Joseph Lee
el 14 de Nov. de 2017
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!