Data Type Mappings Between C++ and Strongly Typed MATLAB Code
C++ to MATLAB
This table lists the data type mapping of C++ data types into strongly typed MATLAB® data types.
Description | C++ Data Type | MATLAB Data Type Representation |
---|---|---|
Real double scalar |
|
|
Real double vector |
|
|
Complex double scalar Note Can be passed to MATLAB as plain real through C++ overloading |
|
|
Complex double vector Note Can be passed to MATLAB as plain reals through C++ overloading
|
|
|
Real single scalar |
|
|
Real single vector |
|
|
Complex single scalar Note Can be passed to MATLAB as plain real through C++ overloading |
|
|
Complex single vector Note Can be passed to MATLAB as plain reals through C++ overloading |
|
|
Real integer scalars |
|
|
Real integer vectors |
|
|
Complex integer scalars |
|
|
Complex integer vectors |
|
|
Logical scalar |
|
|
Logical vector |
|
|
Char scalar |
|
|
Char vector |
|
|
String |
|
|
String vector |
|
|
Enum scalar |
|
|
Enum vector |
|
|
MATLAB to C++
The following table lists the data type mapping of strongly typed MATLAB data types to C++ data types.
Description | MATLAB Data Type | C++ Data Type Representation |
---|---|---|
Real double scalar |
|
|
Real double vector |
|
|
Complex double scalar Note Stored as a complex number, even if result is real
|
|
|
Complex double vector Note Stored in MATLAB Data Array if result is real
|
|
If result
contains
|
Real single scalar |
|
|
Real single vector |
|
|
Complex single scalar |
|
|
Complex single vector |
|
If result
contains
|
Real integer scalars |
|
|
Real integer vectors |
|
|
Complex integer scalars |
|
|
Complex integer vectors |
|
If result
contains
|
Logical scalar |
|
|
Logical vector |
|
|
Char scalar |
|
|
Char vector |
|
|
String |
|
|
String vector |
|
|
Enum scalar |
|
|
Enum vector |
|
|
MATLAB cell scalar |
|
|
MATLAB cell vector |
|
|
MATLAB struct |
|
|
MATLAB struct |
|
|