| Contents | Index |
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues)
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues,
'Description', ClassDesc)
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues,
'DefaultValue', DefValue)
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues,
'HeaderFile', FileName)
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues,
'AddClassNameToEnumNames', Flag)
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues) defines an enumeration named ClassName with enumeration values specified with CellOfEnums and underlying numeric values specified by IntValues.
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues, 'Description', ClassDesc) defines the enumeration with a description (string).
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues, 'DefaultValue', DefValue) defines a default value for the enumeration, which is one of the strings you specify for CellOfEnums.
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues, 'HeaderFile', FileName) specifies a header file into which the code generator places the enumeration class definition.
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues, 'AddClassNameToEnumNames', Flag) specifies whether the code generator applies the class name as a prefix to the enumeration values that you specify for CellOfEnums. For Flag, specify true or false. For example, if you specify true, the code generator would use BasicColors.Red instead of Red to represent an enumerated value.
Assume an external data dictionary includes the following enumeration:
BasicColors.Red(0), BasicColors.Yellow(1), BasicColors.Blue(2)
Import the enumeration class definition into the MATLAB workspace:
Simulink.defineIntEnumType('BasicColors', ...
{'Red', 'Yellow', 'Blue'}, ...
[0;1;2], ...
'Description', 'Basic colors', ...
'DefaultValue', 'Blue', ...
'HeaderFile', 'mybasiccolors.h', ...
'DataScope', 'Imported', ...
'AddClassNameToEnumNames', true);

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |