This function makes a gaussian fit of a distribution of data. It is based on the MATLAB built-in function lscov. Indeed it is an interface to lscov in the log space of the distribution. It also implements an algorithm that automatically calculates the array of weights in order to remove the bias introduced by the noise in the tails of the distribution.
Adding the examples
Adding the function file