hist(Y)
hist(Y, nbins)
hist(Y, centers)
n = hist(...)
[n, c] = hist(...)
| Parameter | Description |
|---|---|
| Y | a numeric vector. |
| nbins | a scalar: number of equally spaced bins (default 10). |
| centers | a vector of bin centers. |
| Parameter | Description |
|---|---|
| n | the number of elements in each bin. |
| c | the bin centers. |
hist distributes the elements of Y into bins and returns the bin counts.
Two modules carry a hist: this one and the one in the graphics module. Both count their bins the same way, so the same call answers the same counts either way. The graphics one takes over as soon as that module is loaded: it is the one that draws, and the only one that accepts a designated axes. This one is what answers where graphics is not loaded, as in nelson-cli, and it only counts: asking it to draw reports that the graphics module is needed.
This is a legacy function; histogram and histcounts are preferred for new code.
[n, c] = hist([2 4 4 4 5 5 7 9], 3)
| Version | Description |
|---|---|
| 1.14.0 | initial version |