Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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

Supose I have a list of 600 samples of numbers, and the histogram of the samples looks like the following:

enter image description here

As can be seen, there are two 'mountains' of values around 16 and 48, and a outlier in 95. I would like to implement an algorithm for retrieving this values: 16 and 48.

Any help will be appreciated,

share|cite|improve this question

If you know that there are only two peaks, you can try to fit the data with a sum of two Gaussians: $$f(x) = A_1 \exp(-w_1 (x-x_1)^2) + A_2 \exp(-w_2 (x-x_2)^2)$$ Matlab has a curve fitting toolbox that should be able to solve 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.