No BSD License  

Highlights from
AHIST

5.0

5.0 | 1 rating Rate this file 1 Download (last 30 days) File Size: 3.9 KB File ID: #16700
image thumbnail

AHIST

by Durga Lal Shrestha

 

03 Oct 2007 (Updated 03 Oct 2007)

Combined good features of hist and histc

| Watch this File

File Information
Description

AHIST Alternative to Histogram.
 Motivation: to combine the good features of HIST and HISTC.

 USAGE:
            n = ahist(Y)
            n = ahist(Y,nbin)
            n = ahist(Y,xedges)
 [n,xc,index] = ahist(...)
                ahist(...) without output arguments produces a
                histogram bar plot of the results.
 
 INPUT:
       Y: Vector or Matrix of data. If Y is Matrix, AHIST works down
             the columns.
    nbin: Number of bins
  xedges: Matrix of edges for each column vector of data
           
 OUTPUT:
        n: Number of elements in each container.
       xc: The position of the bin centers in X
    index: Index matrix BIN.

 FEATURES:
 1. Returns the index matrix (histc)
 2. Either uses nbins (hist) or xedges (histc)
 3. Returns centre of the bin (hist)
 4. Plot histogram of each column of matrix in subplots

 WHY AHIST:
 1. Note that in histc, the last bin counts any values of x that
    match edges(end). But AHIST(Y) bins the elements of Y into 10 equally
    spaced containers like in hist.
 2. When working the matrix, HIST and HISTC uses same container based on
    the range of the whole matrix for all column of the matrix.
    But AHIST uses different container for each column based on the range
    of data in each column.

 See also HIST HISTC

 Copyright 2004-2007 by Durga Lal Shrestha.
 eMail: durgals@hotmail.com
 $Date: 2007/10/02
 $Revision: 1.0.0 $ $Date: 2007/10/02 $

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
03 Oct 2007 Dimitri Shvorob

The multi-column functionality is new, but rather special; I think I'll stick with own HISTF for now :)
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=14597&objectType=FILE

11 Jun 2010 Pei  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Durga Lal Shrestha 22 Oct 2008 09:30:05
probability Durga Lal Shrestha 22 Oct 2008 09:30:05
histogram Durga Lal Shrestha 22 Oct 2008 09:30:05
frequency Durga Lal Shrestha 22 Oct 2008 09:30:05
ahist Durga Lal Shrestha 22 Oct 2008 09:30:05
alternative Durga Lal Shrestha 22 Oct 2008 09:30:05

Contact us at files@mathworks.com