Enums of smaller data types

9 ビュー (過去 30 日間)
John F
John F 2019 年 11 月 21 日
回答済み: Walter Roberson 2019 年 11 月 21 日
Hi everyone,
I am wondering if there's a way to create enumerated types of smaller sizes. When generating code with Simulink models that use enums, "IntEnumType" gets cast as a machine-sized Int, in my case a 4-byte value. It takes up a lot of memory especially when you consider most of the enums only have a small number of values. Is there an easy way to avoid this?
Thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 11 月 21 日
  • Define the class as a subclass of Simulink.IntEnumType. You can also base an enumerated type on one of these built-in integer data types: int8, uint8, int16, uint16, and int32.

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by