M-Files which plot a histogram with a gaussian fit to the data and write the information to the screen as well as on the command line.
The general usage is hfitg(array,num_of_bins) you can also use hfitg(array,num_of_bins,min_value,max_value) Where min_value and max_value will be the min/max limits of the histogram.
The function also calculates the chi^2 of the fit and reports this as well as the number of degrees of freedom.
These routines are based on similar routines in PAW that I found I couldn't live without. Hope they are of use to others.
chisq_min.m needs updated to remove the use of deprecated methods as the 9 Dec 2006 post suggest.
Current file contents
options.MaxIter = 500 * prod(size(x));
parout = fminsearch( 'gx', par, options );
There are other fields that could be filled in that are used by fminsearch (see link below), but this was sufficient to get working. The code seems to be doing exactly what I needed at this time.
Works great - in the chisq_min.m file you need to replace the reference to fmins() wiht fminsearch() for it to work with later Matlab releases.
Gaussiran.. is that your real last name..?
excellent code btw, very useful