(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.
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, then C
is
a vector containing as many elements as the number of levels in
A
.
If A
is a matrix, then C
is
a matrix of column counts.
If A
is an N-dimensional
array, then levelcounts
operates along the first
nonsingleton dimension.