genarate random integers from normal distribution

8 views (last 30 days)
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

Answers (1)

John D'Errico
John D'Errico on 8 Jun 2014
Edited: John D'Errico on 8 Jun 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.

Categories

Find more on Random Number Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!