<< nan_gscatter Statistical Visualization nan_nhist >>

NaN Toolbox >> NaN Toolbox > Statistical Visualization > nan_hist

nan_hist

Produce histogram counts or plots

Calling Sequence

nn = nan_hist(Y)
nn = nan_hist(Y,nbins)
nn = nan_hist(Y,X)
nan_hist(...,'plot')  produces a histogram bar plot of the results.
nan_hist(AX,...) plots into AX instead of GCA.
[nn,xx] = nan_hist(...)

Parameters

Y:

input vector or matrix. If Y is a matrix, hist works down the columns.

nbins:

number of equally spaced containers in which Y is sorted [default: 10]

X:

X is a vector which specifies centers of each container. The first bin includes data between -inf and the first center and the last bin includes data between the last bin and inf. Note: Use HISTC if it is more natural to specify bin edges instead.

nn:

number of elements in each container

xx:

position of the bin centers in X.

Description

With one vector input argument, Y, produces a histogram of the valueswith 10 bins. The range of the histogram bins is determined by the range of the data. With one matrix input argument, Y, plot a histogram where each bin contains a bar per input column.

Given a second vector argument, X, use that as the centers of the bins, with the width of the bins determined from the adjacent values in the vector.

If scalar, the second argument, nbins, defines the number of bins.

Extreme values are lumped in the first and last bins.

With two output arguments, produce the values nn and xx such that bar (xx, nn) will plot the histogram.

Examples

x = -4:0.1:4;
y = rand(10000,1,'normal');
nan_hist(y,x,'plot')

See also

Authors

<< nan_gscatter Statistical Visualization nan_nhist >>