isenum
Determine if variable is enumeration
Syntax
Description
tf = isenum( returns
logical 1 (e)true) if e is an
enumeration. Otherwise, it returns logical 0 (false).
Empty enumeration objects return true.
If e is a heterogeneous array, isenum always
returns false.
Examples
Test for Enumeration
Determine if a variable is an enumeration.
The PPM class defines enumerations for three
levels:
classdef PPM < int32 enumeration High (1000) Medium (100) Low (10) end end
Create a variable representing a level. Use isenum to
determine if the variable is an enumeration:
currentLevel = PPM.High; isenum(currentLevel)
ans =
1Input Arguments
More About
Extended Capabilities
Version History
Introduced in R2015a