genarate random integers from normal distribution

12 visualizaciones (últimos 30 días)
joy
joy el 8 de Jun. de 2014
Editada: John D'Errico el 8 de Jun. de 2014
Hi,
I want to generate a set of 50 random variable having std_deviation 0.1 and mean 0.5 from a normal distribution...it can be float
but I want to generate 50 random integers with std_deviation 3500 and mean 4000..
how to do the both with
randn?
any idea, pls share..thanks
regrads

Respuestas (1)

John D'Errico
John D'Errico el 8 de Jun. de 2014
Editada: John D'Errico el 8 de Jun. de 2014
help randn
will tell you how to generate a set with a given mean and variance. Why not read the help? Or take a basic class in probability & statistics.
As for integers, you cannot do so. A normal distribution is CONTINUOUS. That says your question has no meaning in mathematics.
You can generate integers that are APPROXIMATELY normally distributed. Round will do that for you here.

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by