本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

MATLAB 数据 API

创建可用于 MATLAB® 数据的 C++ 程序

MATLAB 数据 API 为在 MATLAB 外部运行的应用程序提供了一种方法,可通过独立于 MATLAB 的接口来处理 MATLAB 数据。此 API 使用现代 C++ 语义和设计模式,并通过使用 MATLAB 的写入时复制 (copy-on-write) 语义来尽可能地避免数据复制。

注意

MATLAB 数据 API 支持现代 C++ 功能,但与 C 矩阵 API 不兼容。您不能在 MEX 文件中将来自 MATLAB Data API 的函数与来自 C 矩阵 API 和 C MEX API 的函数混合使用。同样,您不能在独立应用程序中将 MATLAB 数据 API 函数与 用于 C 的 MATLAB 引擎 API用于读取 MAT 文件数据的 MATLAB C API 中的函数混合使用。

Factory

matlab::data::ArrayFactoryC++ class to create arrays

数组类型

matlab::data::ArrayC++ base class for all array types
matlab::data::TypedArray<T>Templated C++ class to access array data
matlab::data::CellArrayC++ class to access MATLAB cell arrays
matlab::data::CharArrayC++ class to access MATLAB character arrays
matlab::data::EnumArrayC++ class to access MATLAB enumeration arrays
matlab::data::ObjectArrayC++ class to access MATLAB object arrays
matlab::data::SparseArray<T>Templated C++ class to access data in MATLAB sparse arrays
matlab::data::StringArrayC++ class to access MATLAB string arrays
matlab::data::StructArrayC++ class to access MATLAB struct arrays

数据类型

matlab::data::ArrayTypeC++ array type enumeration class
matlab::data::ArrayDimensionsType specifying array dimensions
matlab::data::EnumerationElement type for MATLAB enumeration arrays
matlab::data::MATLABFieldIdentifierC++ class used to identify field names in MATLAB struct array
matlab::data::MATLABStringElement type for MATLAB string arrays
matlab::data::ObjectElement type for MATLAB object arrays
matlab::data::optional<T>Templated C++ class representing optional values
matlab::data::StringType representing strings as std::basic_string<char16_t>
matlab::data::StructElement type for MATLAB struct arrays

引用

matlab::data::Reference<T>Templated C++ class to get references to Array elements
matlab::data::Reference<MATLABString>C++ class to get reference to element of StringArray
matlab::data::Reference<Struct>C++ class to get reference to element of StructArray
matlab::data::Reference<Array>C++ class to get reference to Array
matlab::data::Reference<TypedArray<T>>Templated C++ class to get reference to TypedArray
matlab::data::Reference<SparseArray<T>>Templated C++ class to get reference to SparseArray
matlab::data::Reference<CharArray>C++ class to get reference to CharArray
matlab::data::Reference<EnumArray>C++ class to get reference to EnumArray
matlab::data::Reference<StructArray>C++ class to get reference to StructArray

迭代器

matlab::data::TypedIterator<T>Templated C++ class to provide random access iterator
matlab::data::ForwardIterator<T>Templated C++ class to provide forward iterator support for StructArray field names
matlab::data::Range<ItType,ElemType>Templated C++ class to provide range-based operation support

辅助函数

matlab::data::apply_visitorCall Visitor class on arrays
matlab::data::apply_visitor_refCall Visitor class on array references

异常

matlab::ExceptionC++ base class for exceptions

主题

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 and StructArray 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 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.