主要内容

Simulink.IntEnumType Class

Namespace: Simulink

Abstract class for defining enumerations

Description

The Simulink.IntEnumType class is an abstract class for defining an enumerated data type. An enumerated data type defines a set of enumerated values. Each enumerated value consists of an enumerated name and an underlying integer which the software uses internally and in generated code.

To create an enumerated data type that you can use in Simulink® models, define an enumeration class as a subclass of Simulink.IntEnumType using a classdef block in a MATLAB® file.

Alternatively, you define an enumerated data type by using one of these methods:

Methods

expand all

Examples

collapse all

Create an enumerated type BasicColors derived from the abstract class Simulink.IntEnumType.

classdef  BasicColors < Simulink.IntEnumType
    enumeration
        Red(0)
        Yellow(1)
        Blue(2)
    end
end

Version History

Introduced before R2006a