Main Content

MATLAB Data API Types

matlab::data::ArrayDimensions

ArrayDimensions is defined as std::vector<size_t> in the ArrayDimensions.hpp header file.

matlab::data::Enumeration

Enumeration is defined in the Enumeration.hpp header file.

matlab::data::MATLABString

MATLABString is defined as optional<String> in the String.hpp header file.

matlab::data::ObjectArray

ObjectArray is defined as TypedArray<Object> in the ObjectArray.hpp header file.

matlab::data::String

String is defined as std::basic_string<uchar> in the String.hpp header file.

matlab::data::Struct

Struct is defined in the Struct.hpp header file.

buffer_ptr_t and buffer_deleter_t

buffer_ptr_t is defined as std::unique_ptr<T[], buffer_deleter_t>, where buffer_deleter_t is defined as void (*)(void*).

Use get() to access the data. Do not call release(). For an example, see Pass Sparse Arrays to MATLAB From C++.

iterator

iterator is defined as TypedIterator<T> in the TypedArray.hpp header file.

const_iterator

const_iterator is defined as TypedIterator<typename std::add_const<T>::type> in the TypedArray.hpp header file.

reference

reference is defined in the TypedArray.hpp header file as typename iterator::reference, where iterator::reference is T& for arithmetic types and Reference<T> for non-arithmetic types.

const_reference

const_reference is defined in the TypedArray.hpp header file as typename const_iterator::reference, where const_iterator::reference is T& for arithmetic types and Reference<T> for non-arithmetic types.

Reference Types

  • ArrayRef is defined as Reference<Array> in the TypedArrayRef.hpp header file.

  • CellArrayRef is defined as Reference<TypedArray<Array>> in the TypedArrayRef.hpp header file.

  • CharArrayRef is defined as TypedArrayRef<CHAR16_T> in the CharArray.hpp header file.

  • EnumArrayRef is defined as TypedArrayRef<Enumeration> in the EnumArray.hpp header file.

  • SparseArrayRef is defined as Reference<SparseArray<T>> in the SparseArrayRef.hpp header file.

  • StructArrayRef is defined as Reference<TypedArray<Struct>> in the TypedArrayRef.hpp header file.

  • TypedArrayRef is defined as Reference<TypedArray<T>> in the TypedArrayRef.hpp header file.