Main Content
Enumerations
Definition and use of enumerated data for MATLAB Function
blocks
Enumerations represent a fixed set of named values. Enumerations help make
your MATLAB® code more readable. In a MATLAB Function block,
enumeration classes must derive from Simulink.IntEnumType
, int8
,
uint8
, int16
, uint16
,
int32
, or uint32
. If you use Simulink®
Coder™ to generate C/C++ code, the enumeration class base type determines
how the enumeration is represented in the generated code.
Blocks
MATLAB Function | Include MATLAB code in Simulink models |
Topics
- Code Generation for Enumerations
Use enumerations in MATLAB code intended for code generation.
- Add Enumerated Inputs, Outputs, and Parameters to a MATLAB Function Block
Use the Symbols pane and the Property Inspector to specify enumerated types for MATLAB Function block inputs, outputs, and parameters.