countcats
Count occurrences of categorical array elements by category
Description
B = countcats( returns the number of elements in
                each category of a categorical array. The counts are in the same order as the
                categories listed by the A)categories function.
- If - Ais a vector, then- countcatsreturns the number of elements in each category.
- If - Ais a matrix, then- countcatstreats the columns of- Aas vectors and returns the category counts for each column of- A.
- If - Ais a multidimensional array, then- countcatsacts along the first array dimension whose size does not equal- 1.
To display a summary of a categorical array that shows both category names and the
                number of elements in each category, use the summary function.
Examples
Input Arguments
Tips
- To find the number of undefined elements in a categorical array, you must use - summaryor- isundefined.
Extended Capabilities
Version History
Introduced in R2013b
See Also
iscategory | ismember | summary | isundefined | categories

