Create MATLAB object for C++ array or std::vector
cArray = clibArray(
creates a MATLAB® object representing a C++ object of typeName
,dimensions
)typeName
with C++
dimensions specified as [x1,...,xN]
. If the C++ object is a primitive
type, then cArray
contains zero values. If the C++ object is a
class-type, then MATLAB initializes cArray
using the default
constructor.
A MATLAB clib array can be defined only when the corresponding C++ native array or
std::vector
is used by supported C++ constructs — function arguments,
function returns, and data members.
The memory of cArray
is owned by MATLAB. To release the memory, call clibRelease
.
To convert a MATLAB array to a C++ array, call clibConvertArray
.