underlyingValue - Underlying numeric value for C++ enumeration object created in MATLAB - MATLAB (original) (raw)

Main Content

Underlying numeric value for C++ enumeration object created in MATLAB

Syntax

Description

underlyingValue([cppEnum](#mw%5F667011be-d5d8-4e0f-ac5f-97fdb8f237d1)) returns the underlying numeric value for a C++ enumeration object created in MATLAB®. underlyingValue is an instance method of the enumeration.

example

Examples

collapse all

Display Underlying Color Value

Create a file enums.hpp with these statements.

enum class COLOR {

RED=100, BLUE=500, BLACK=1000, WHITE=5000,

};

Build the C++ interface.

clibgen.buildInterface('enums.hpp') addpath enums

Type clib.enums.COLOR., then pressTab. Select BLACK.

Display the underlying numeric value.

underlyingValue(clib.enums.COLOR.BLACK)

Input Arguments

collapse all

cppEnum — C++ enumeration created in MATLAB

C++ enumeration object

C++ enumeration created in MATLAB, specified as a C++ enumeration object.

Example: clib.enums.COLOR.BLACK

Version History

Introduced in R2019a