External Interfaces Previous page   Next Page

Enumerated Types

For arguments defined as C enumerated types, you can pass either the enumeration string or its integer equivalent.

The readEnum function from the shrlibsample library returns the enumeration string that matches the argument passed in. Here is the Enum1 definition and the readEnum function in C:

In MATLAB, you can express an enumerated type as either the enumeration string or its equivalent numeric value. The TEnum1 definition above declares enumeration en4 to be equal to 4. Call readEnum first with a string:

Now call it with the equivalent numeric argument, 4:


Previous page  Primitive Types Structures Next page

© 1994-2005 The MathWorks, Inc.