Underlying numeric value for C++ enumeration object created in MATLAB
underlyingValue(cppEnum)
example
underlyingValue(cppEnum) returns the underlying numeric value for a C++ enumeration object created in MATLAB®. underlyingValue is an instance method of the enumeration.
cppEnum
underlyingValue
collapse all
Create a file enums.hpp with these statements.
enums.hpp
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 press Tab. Select BLACK.
clib.enums.COLOR.
BLACK
Display the underlying numeric value.
underlyingValue(clib.enums.COLOR.BLACK)
ans = int32 1000
C++ enumeration created in MATLAB, specified as a C++ enumeration object.
Example: clib.enums.COLOR.BLACK
clib.enums.COLOR.BLACK
clibgen.buildInterface