levelcounts
(Not Recommended) Element counts by level of a nominal or ordinal array
The nominal
and ordinal
array data types are not
recommended. To represent ordered and unordered discrete, nonnumeric data, use the Categorical Arrays
data type instead.
Description
returns counts of the number of elements in the nominal or ordinal array
C
= levelcounts(A
)A
equal to each possible level in A
.
If
A
is a vector, thenC
is a vector containing as many elements as the number of levels inA
.If
A
is a matrix, thenC
is a matrix of column counts.If
A
is an N-dimensional array, thenlevelcounts
operates along the first nonsingleton dimension.
Examples
Input Arguments
Version History
Introduced in R2007a