| Statistics Toolbox | Search  Help Desk |
| histfit | Examples See Also |
Histogram with superimposed normal density.
Syntax
histfit(data) histfit(data,nbins) h = histfit(data,nbins)
Description
histfit(data,nbins) plots a histogram of the values in the vector data using nbins bars in the histogram. With one input argument, nbins is set to the square root of the number of elements in data.
h = histfit(data,nbins) returns a vector of handles to the plotted lines. h(1) is the handle to the histogram, h(2) is the handle to the density curve.
Example
r = normrnd(10,1,100,1); histfit(r)
![]()
See Also
hist, normfit