Simulink.data.isSupportedEnumClass

Determine whether an enumeration class is valid for Simulink

Syntax

valid = Simulink.data.isSupportedEnumClass(enumClass)

Description

example

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

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 meta.class object as the input.

Simulink.data.isSupportedEnumClass(?BasicColors)
ans =

  logical

   1

Check if Simulink.NumericType is a valid enumeration class by using the meta.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 meta.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.

Introduced in R2014b