This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

na_0033: Enumerated Types Usage

ID: Title

na_0033: Enumerated Types Usage

Priority

Recommended

Scope

NA-MAAB

MATLAB Versions

R2010b and later

Prerequisites

None

Description

An enumerated data type should be used when a signal or parameter can take on a finite set of integer values, and those values are associated with a set of named items. The names, called literals, have meaning in the context of the algorithm or the domain in which it operates. Typically, these literals represent an operating mode, signal status, build variation, or some other discrete property that the quantity represented by the variable can take on. A typical automotive example of this is the modes of a transmission: Park, Reverse Neutral, Drive, Low.

Rationale

  • Readability

  • Verification and Validation

  • Workflow

  • Code Generation

  • Simulation

See Also

  • NASA Orion style guideline dm_0002: Enumerated type usage

Last Changed

V3.0

Model Advisor Check

Not applicable

Introduced in R2013a