Data Exchange and Mapping with C++ Applications
Examples that use the C++ Engine API and MATLAB Data API for C++ to pass data between C++ programs and MATLAB® functions.
Use the strongly typed interface to enforce a strict data type mapping between
MATLAB and C++. Call the matlab.engine.typedinterface.generateCPP
function to generate
C++ header files for MATLAB functions and classes. Then, when you build a C++ application with
these header files, you can use MATLAB functions and classes as C++ functions and classes without writing
C++ code.
Functions
Topics
Create MATLAB Data Types
- Create Structure Arrays from C++
Create structure arrays in C++ and pass to MATLAB or get structure arrays defined in MATLAB. - Create Cell Arrays from C++
Create heterogeneous arrays in C++ to use as MATLAB cell arrays. - Pass Enumerations to MATLAB from C++
Pass members of a MATLAB enumeration class to MATLAB from C++. - Pass Sparse Arrays to MATLAB from C++
Pass arrays to MATLAB as MATLAB sparse arrays. - Use MATLAB Handle Classes in C++
Integrate MATLAB handle classes with C++ applications.
Strongly Typed Interface
- What Is Strongly Typed Interface for C++?
The C++ MATLAB Data API interface supports strongly typed MATLAB code. - Write MATLAB Code for Strongly Typed C++ Interface
Specify data type requirements in MATLAB code. - Create C++ Header File from Strongly Typed MATLAB Function
Integrate a MATLAB Data API C++ header file from a strongly typed MATLAB function with C++ application code that calls MATLAB. - Data Type Mappings Between C++ and Strongly Typed MATLAB Code
Refer to data type mappings between C++ and MATLAB when using strongly typed MATLAB code. - Limitations of Strongly Typed Interface for C++
Strongly typed interface for C++ features not supported in MATLAB.
Troubleshooting
MATLAB Engine API for C++ Exception Classes
The MATLAB engine API for C++ defines specific exception classes for MATLAB.