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 MATLAB Engine API for C or the MATLAB C API to Read MAT-File Data in a standalone application.
Create Arrays with C++ MATLAB Data API
Create MATLAB array.
The matlab::data::Array
class supports both copy and move semantics.
Access C++ Data Array Container Elements
The C++ MATLAB Data API CellArray
and StructArray
types are containers for other MATLAB Data 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.
The MATLAB Data API defines specific exception classes for MATLAB.
The MATLAB Data API defines specific types for working with MATLAB.