title: Generate a probability distribution from a histogram with two peaks
body: <p><img src="https://i.stack.imgur.com/7XOdZ.png" alt="enter image description here">I have a histogram with two peaks and I want to generate the corresponding probability distribution. I have used the following MATLAB code:</p>
  
  <pre><code>A=mydata;
  M1=max(A);
  M2=min(A);
  I=(0:100).*(M1-M2)./100+M2;
  [n,x]=hist(A,I);
  bar(x,n/(1000*0.352))
  </code></pre>
  
  <p>I found this code frequently to explain how we can find a prob distribution for a histogram of random numbers normally distributed but I don't know whether if this true for a histogram with two peaks and generate a normalised probability distribution.</p>