Main Content

Simulink.data.isSupportedEnumObject

Determine whether an enumeration object is valid for Simulink

Description

example

valid = Simulink.data.isSupportedEnumObject(enumObject) returns true if enumObject is a valid enumeration object for Simulink®.

Examples

collapse all

Define an enumeration class of basic colors.

Simulink.defineIntEnumType('BasicColors', ... 
	{'Red', 'Yellow', 'Blue'}, ...
	[0;1;2]);

Confirm that an instance of the enumeration class is valid.

Simulink.data.isSupportedEnumObject(BasicColors.Yellow)
ans =

  logical

   1

Call the function with input that is not an enumeration object.

Simulink.data.isSupportedEnumObject(5)
ans =

  logical

   0

Input Arguments

collapse all

Instance of a defined enumeration, specified as an enumeration object.

Example: myEnumObject

Output Arguments

collapse all

If the input value refers to a valid enumeration object for Simulink, valid is true, otherwise valid is false.

Version History

Introduced in R2014b