No BSD License  

Highlights from
hist2

4.33333

4.3 | 3 ratings Rate this file 8 Downloads (last 30 days) File Size: 3.5 KB File ID: #298

hist2

by

 

Plots a histogram with a gaussian fit to the data.

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 5.2 (R10)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
16 Apr 2012 Seth

chisq_min.m needs updated to remove the use of deprecated methods as the 9 Dec 2006 post suggest.

Current file contents
--------------------
options=foptions;
options(14)= 500*prod(size(x));
parout=fmins('gx',par,options);

Replace with
------------
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.

http://www.mathworks.com/help/techdoc/ref/fminsearch.html

09 Dec 2006 Colin O'Flynn

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.

24 Nov 2004 Will Yuen

Gaussiran.. is that your real last name..?

excellent code btw, very useful

Contact us