MATLAB Data API for C++
The MATLAB Data API provides a way for applications running outside of MATLAB to work with MATLAB data through a MATLAB-neutral interface. The API uses modern C++ semantics and design patterns and avoids data copies whenever possible by using MATLAB copy-on-write semantics.
Note
The MATLAB Data API supports modern C++ features and is not compatible with the C Matrix API. You cannot mix functions from the MATLAB Data API with those in the C Matrix API and C MEX API in a MEX file. Likewise, you cannot mix MATLAB Data API functions with functions in the C Engine API, described in Call MATLAB from C, or the C MAT-File API, described in Write C Programs to Read MAT-File Data.
Classes
Topics
- Create Arrays with C++ MATLAB Data API
Create MATLAB array.
- Copy C++ MATLAB Data Arrays
The
matlab::data::Array
class supports both copy and move semantics. - Access C++ Data Array Container Elements
The C++ MATLAB Data API
CellArray
andStructArray
types are containers for other MATLAB Data Arrays. - C++ Cell Arrays
To create a cell array, use the
matlab::data::ArrayFactory
createCellArray
function. - Operate on C++ Arrays Using Visitor Pattern
The visitor design pattern is a useful technique for performing various operations on arrays.
- MATLAB Data API Random Access Iterators
The MATLAB Data API provides random access iterators based on the C++ language specification.
- Create MATLAB Data Array and Manage Memory from User-Managed Buffer
How to allow MATLAB to work directly with arrays allocated by third-party libraries.
- MATLAB Data API Exceptions
The MATLAB Data API defines specific exception classes for MATLAB.
- MATLAB Data API Types
The MATLAB Data API defines specific types for working with MATLAB.