Statistics Toolbox
  Go to function:
    Search    Help Desk 
hist    Examples   See Also

Plot histograms.

Syntax

Description

hist calculates or plots histograms.

hist(y) draws a 10-bin histogram for the data in vector y. The bins are equally spaced between the minimum and maximum values in y.

hist(y,nb) draws a histogram with nb bins.

hist(y,x) draws a histogram using the bins in the vector, x.

[n,x] = hist(y), [n,x] = hist(y,nb), and [n,x] = hist(y,x) do not draw graphs, but return vectors n and x containing the frequency counts and the bin locations such that bar(x,n) plots the histogram. This is useful in situations where more control is needed over the appearance of a graph, for example, to combine a histogram into a more elaborate plot statement.

Examples

Generate bell-curve histograms from Gaussian data.

See Also

hist is a function in MATLAB.



[ Previous | Help Desk | Next ]