Main Content

Generate Code for Enumerations

The basic workflow for generating code for enumerated types in MATLAB® code is:

  1. Define an enumerated data type that derives from one of these base types: int8, uint8, int16, uint16, int32, or uint32.

  2. Save the enumerated data type in a file on the MATLAB path.

  3. Write a MATLAB function that uses the enumerated type.

  4. Specify enumerated type inputs.

  5. Generate code.

Related Topics