Statistics Toolbox    
hist

Plot histograms

Syntax

Description

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,...) 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.

The hist function is a part of the standard MATLAB language.

Examples

Generate bell-curve histograms from Gaussian data.


  harmmean histfit