Main Content

Simulink.data.isSupportedEnumClass

Determine whether an enumeration class is valid for Simulink

Description

valid = Simulink.data.isSupportedEnumClass(enumClass) returns true if enumClass is a valid enumeration class for Simulink®.

example

Examples

collapse all

Define an enumeration class of basic colors, then confirm that it is valid.

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

  logical

   1

Perform the same validity check by using the matlab.metadata.Class object as the input.

Simulink.data.isSupportedEnumClass(?BasicColors)
ans =

  logical

   1

Check if Simulink.NumericType is a valid enumeration class by using the matlab.metadata.Class object as the input.

Simulink.data.isSupportedEnumClass(?Simulink.NumericType)
ans =

  logical

   0

Input Arguments

collapse all

Enumeration class, specified as a character vector or as matlab.metadata.Class object.

Example: 'myEnumClass' or ?myEnumClass

Output Arguments

collapse all

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

Version History

Introduced in R2014b