Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

Default Code for an Enumerated Data Type

By default, enumerated data types in generated code are defined in the generated header file model_types.h for the model. For example, the default code for BasicColors, which is defined in the previous section, appears as follows:

#ifndef _DEFINED_TYPEDEF_FOR_BasicColors_
#define _DEFINED_TYPEDEF_FOR_BasicColors_

typedef enum {
  Red = 0,            /* Default value */
  Yellow = 1,
  Blue = 2,
} BasicColors;

#endif
  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS