iscategory
Determine whether names are categories.
📝Syntax
tf = iscategory(A, names)
📥Input Arguments
Parameter Description
A Input categorical array.
names Category name, string array, cell array of character vectors, or pattern to test.
📤Output Arguments
Parameter Description
tf Logical result with the same size as names, except for pattern input where a scalar result is returned.
📄Description

iscategory tests whether requested names are present in the category list of A.

Undefined elements do not create a category and are not matched by this function.

💡Examples
Check several category names.
A = categorical({'red','blue'}); tf = iscategory(A, {'red','green'})
🔗See Also
categoriesaddcatsremovecatsisundefined
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub