No BSD License  

Highlights from
hist2 for the people

5.0

5.0 | 1 rating Rate this file 26 Downloads (last 30 days) File Size: 1.91 KB File ID: #12346
image thumbnail

hist2 for the people

by Nedialko Krouchev

 

20 Sep 2006 (Updated 21 Sep 2006)

2D histogram: Extract the number of joint events - (x,y) data value pairs

| Watch this File

File Information
Description

2D histogram: Extract the number of joint events - (x,y) data value pairs that fall in each bin of the grid defined by xedges and yedges.

Uses:

[N,BIN] = HISTD(X,EDGES)

which returns

1) N is a LENGTH(EDGES) vector, N(k) will count the value X(i) if EDGES(k) <= X(i) < EDGES(k+1). The last bin will count any values of X that match EDGES(end).

2) an index matrix BIN. If X is a vector, N(K) = SUM(BIN==K). BIN is zero for out of range values. If X is an m-by-n matrix, then, for j=1:n, N(K,j) = SUM(BIN(:,j)==K); end

Please, see the notes to HISTD too.

N.B. It is always a better idea to use the HISTC MEX (a much faster compiled C code) if you have it, then just replace the HISTD with HISTC in all calls contained in the hist2() .m function

Small print Note: There is a similar f/n - hist3 - in the R14 stats, but on top of everything else that makes it inaccessible, it looks looong

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
2D Histogram Calculation

MATLAB release MATLAB 5.2 (R10)
Other requirements Zip
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
13 Apr 2012 Juan  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Nedialko Krouchev 22 Oct 2008 08:40:26
probability Nedialko Krouchev 22 Oct 2008 08:40:26
2d histogram Cristina McIntire 15 Jan 2009 13:42:09
portable advanced Cristina McIntire 15 Jan 2009 13:42:09
portable advanced Mike 30 Mar 2010 14:50:51
2d histogram Stian Martinsen 05 Apr 2011 05:58:10
hist3 per isakson 12 Jul 2011 19:02:16

Contact us at files@mathworks.com