| Contents | Index |
| On this page… |
|---|
In general, all Simulink tools and constructs support enumerated types for which the support makes sense given the purpose of enumerated types: to represent program states and to control program logic. The Simulink Editor, Simulink Debugger, Port Value Displays, referenced models, subsystems, masks, buses, data logging, and most other Simulink capabilities support enumerated types without imposing any special requirements.
Enumerated types are not intended for mathematical computation, so no block that computes a numeric output (as distinct from passing a numeric input through to the output) supports enumerated types. Thus an enumerated type is not considered to be a numeric type, even though an enumerated value has an underlying integer. See Enumerated Values in Computation for more information.
Most capabilities that do not support enumerated types obviously could not support them. Therefore, the Simulink documentation usually mentions enumerated type nonsupport only where necessary to prevent a misconception or describe an exception. See Simulink Enumeration Limitations for information about certain constructs that could support enumerated types but do not.
The following Simulink blocks support enumerated types:
Constant (but Enumerated Constant is preferable)
Probe (input only)
Relay (output only)
All members of the following categories of Simulink blocks support enumerated types:
Bus-capable blocks (see Bus-Capable Blocks)
Pass-through blocks:
With state, like the Data Store Memory and Unit Delay blocks.
Without state, like the Mux block.
Many Simulink blocks in addition to those named above support enumerated types, but they either belong to one of the categories listed above, or are rarely used with enumerated types. The Data Type Support section of each block reference page describes all data types that the block supports.
The following Simulink classes support enumerated types:
Simulink.Signal
Simulink.Parameter
Simulink.AliasType
Simulink.BusElement
Root-level outports, To Workspace blocks, and Scope blocks can all export enumerated values. Signal and State logging work with enumerated data in the same way as with any other data. All logging formats are supported. The From File block does not support enumerated data. Use the From Workspace block instead, combined with some technique for transferring data between a file and a workspace. See Importing and Exporting Simulation Data for more information.
Root-level inports and From Workspace blocks can output enumerated signals during simulation. Data must be provided in a Structure, Structure with Time, or TimeSeries object. No interpolation occurs for enumerated values between the specified simulation times. From File blocks produce only data of type double, so they do not support enumerated types. See Importing and Exporting Simulation Data for more information.
![]() | Using Enumerated Data in Simulink Models | Simulink Enumeration Limitations | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |