histc
Histogram bin counts (not recommended; usehistcounts
)
histc
is not recommended. Usehistcounts
instead.
For more information, including suggestions on updating code, seeReplace Discouraged Instances of hist and histc.
Syntax
bincounts = histc(x,binranges)
bincounts = histc(x,binranges,昏暗)
[bincounts,ind]= histc(___)
Description
counts the number of values inbincounts
= histc(x
,binranges
)x
在每个指定的垃圾箱范围内。The input,binranges
, determines the endpoints for each bin. The output,bincounts
, contains the number of elements fromx
in each bin.
If
x
是一个向量,然后histc
returnsbincounts
as a vector of histogram bin counts.If
x
是矩阵,然后histc
沿着每一列运行x
并返回bincounts
as a matrix of histogram bin counts for each column.
To plot the histogram, usebar(binranges,bincounts,'histc')
.
Examples
Input Arguments
Output Arguments
提示
如果值在
x
lie outside the specified bin ranges, thenhistc
does not include these values in the bin counts. Start and end thebinranges
vector with-inf
和inf
to ensure that all values inx
are included in the bin counts.