isundefined - Test for undefined elements

Class

@categorical

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.

Example

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     0

See Also

islevel, ismember

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS