This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


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, or int32. 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.


MATLAB Function Include MATLAB code in models that generate embeddable C code


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 Ports and Data Manager to specify enumerated types for MATLAB Function block inputs, outputs, and parameters.

Use Enumerations to Control an LED Display

Use enumerations in a MATLAB Function block that determines the color of an LED display.

Was this topic helpful?