The vector m follows the truncated exponential equation (F_M) and it is shown by solid black line in figure. I intend to fit an exponential distribution function to data and find the parameter lambda (1/mean). Even though I've used fitdist(x,distname), the fitted exp. dist. shown in dashed line which is way different from the data. here is the code:
F_M=(1-exp(-beta*(m-M_min))) / (1-(exp(-beta*(M_max-M_min)))); % CDF of Mag.