Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Histogram bin counts (not recommended; use `histcounts`

)

`histc`

is not recommended. Use `histcounts`

instead.

**For more information, including suggestions on updating code,
see Replace Discouraged Instances of hist and histc.**

counts
the number of values in `bincounts`

= histc(`x`

,`binranges`

)`x`

that are within each
specified bin range. The input, `binranges`

, determines
the endpoints for each bin. The output, `bincounts`

,
contains the number of elements from `x`

in each
bin.

If

`x`

is a vector, then`histc`

returns`bincounts`

as a vector of histogram bin counts.If

`x`

is a matrix, then`histc`

operates along each column of`x`

and returns`bincounts`

as a matrix of histogram bin counts for each column.

To plot the histogram, use `bar(binranges,bincounts,'histc')`

.

`bar`

| `hist`

| `histcounts`

| `histogram`

| `mode`

Was this topic helpful?