genarate random integers from normal distribution

9 次查看(过去 30 天)
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

回答(1 个)

John D'Errico
John D'Errico 2014-6-8
编辑:John D'Errico 2014-6-8
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.

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by