isenum
Determine if variable is enumeration
Syntax
tf = isenum(e)
Description
tf = isenum(
returns logical 1 (e
)true
) ife
is an enumeration. Otherwise, it returns logical 0 (false
). Empty enumeration objects returntrue
.
Ife
is a heterogeneous array,isenum
always returnsfalse
.
Examples
Test for Enumeration
Determine if a variable is an enumeration.
ThePPM
class defines enumerations for three levels:
classdefPPM < int32enumerationHigh (1000) Medium (100) Low (10)endend
Create a variable representing a level. Useisenum
to determine if the variable is an enumeration:
currentLevel = PPM.High; isenum(currentLevel)
ans = 1
Input Arguments
Extended Capabilities
Introduced in R2015a
Was this topic helpful?