Help CenterHelp Center
Determine whether an enumeration class is valid for Simulink
valid = Simulink.data.isSupportedEnumClass(enumClass)
example
valid = Simulink.data.isSupportedEnumClass(enumClass) returns true if enumClass is a valid enumeration class for Simulink®.
valid
enumClass
true
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.
meta.class
Simulink.data.isSupportedEnumClass(?BasicColors)
Check if Simulink.NumericType is a valid enumeration class by using the meta.class object as the input.
Simulink.NumericType
Simulink.data.isSupportedEnumClass(?Simulink.NumericType)
ans = logical 0
Enumeration class, specified as a character vector or as meta.class object.
Example: 'myEnumClass' or ?myEnumClass
'myEnumClass'
?myEnumClass
If the input value refers to a valid enumeration class for Simulink, valid is true, otherwise valid is false.
false
Simulink.defineIntEnumType | Simulink.data.getEnumTypeInfo | Simulink.data.isSupportedEnumObject | Simulink.clearIntEnumType | Simulink.findIntEnumType
Simulink.defineIntEnumType
Simulink.data.getEnumTypeInfo
Simulink.data.isSupportedEnumObject
Simulink.clearIntEnumType
Simulink.findIntEnumType
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office