I have a histogram with two peaks and I want to generate the corresponding probability distribution. I have used the following MATLAB 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))
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.
The histogram is shown here: