Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an array of values (mass function) Px and I want to approximate a normal distribution function (in Matlab) from them.

I can plot the mass function using bar(Px) and I would like to plot normal distribution graph given these data, too.

How do I do it (mathematical formual will be enough for me)?

share|cite|improve this question
To clarify, you have a number of data points which you think are approximately normally distributed and you want to know the normal distribution which best fits the data? If this is incorrect, can you please clarify? – Aaron Oct 15 '12 at 17:35
The normal distribution is characterized by its two parameters: its mean and variance. Find the mean and variance of your data ($\bar{x}$ and $s_x^2$, respectively) and plug those in to the normal density function. – Max Oct 15 '12 at 17:59
to Aaron: that is correct – Smajl Oct 16 '12 at 7:06
up vote 0 down vote accepted

The histfit function in the Statistics toolbox seems to do precisely this:

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.