Enumerations
Definition and use of enumerated data forMATLAB Functionblocks
Enumerations represent a fixed set of named values. Enumerations help make your MATLAB®code more readable. In aMATLAB Functionblock, enumeration classes must derive fromSimulink.IntEnumType
,int8
,uint8
,int16
,uint16
, orint32
. If you use金宝app®Coder™to generate C/C++ code, the enumeration class base type determines how the enumeration is represented in the generated code.
Blocks
MATLAB Function | IncludeMATLABcode in models that generate embeddable C code |
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
使用符号面板和属性检查器specify enumerated types forMATLAB Functionblock inputs, outputs, and parameters.
- Use Enumerations to Control an LED Display
Use enumerations in aMATLAB Functionblock that determines the color of an LED display.