Test for undefined elements
Syntax
I = isundefined(A)
Description
I = isundefined(A) returns
a logical array I the same size as the categorical
array A. I is true (1)
where the corresponding element of A is not assigned
to any level. I is false (0)
where the corresponding element of A is assigned
to a level.
Examples
Create and display undefined levels in an ordinal array:
A = ordinal([1 2 3 2 1],{'lo','med','hi'})
A =
lo med hi med lo
A = droplevels(A,{'med','hi'})
Warning: OLDLEVELS contains categorical levels that
were present in A, caused some array elements to
have undefined levels.
A =
lo <undefined> <undefined> <undefined> lo
I = isundefined(A)
I =
0 1 1 1 0See Also
islevel, ismember
 | isscalar (categorical) | | isvalid (qrandstream) |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit