[n,x] = hist(y,...)
histcalculates 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
hist(y,nb) draws a histogram with
x is a vector, draws a histogram using the bins specified in
[n,x] = hist(y),
[n,x] = hist(y,nb), and
[n,x] = hist(y,x) do not draw graphs, but return vectors
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.
x = -2.9:0.1:2.9;
y = randn(10000,1);
(c) Copyright 1994 by The MathWorks, Inc.