mxDuplicateArray (C and Fortran) - Make deep copy of array - MATLAB (original) (raw)
Main Content
C Syntax
#include "matrix.h" mxArray *mxDuplicateArray(const mxArray *in);
Fortran Syntax
#include "fintrf.h" mwPointer mxDuplicateArray(in) mwPointer in
Arguments
in
Pointer to the mxArray
you want to copy
Returns
Pointer to the created mxArray
. If unsuccessful in a standalone (non-MEX file) application, returns NULL
in C (0
in Fortran). If unsuccessful in a MEX file, the MEX file terminates and returns control to the MATLABĀ® prompt. The function is unsuccessful when there is not enough free heap space to create the mxArray
.
Description
mxDuplicateArray
makes a deep copy of an array, and returns a pointer to the copy. A deep copy refers to a copy in which all levels of data are copied. For example, a deep copy of a cell array copies each cell and the contents of each cell (if any).
Examples
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","refbook","filename")]);
where filename
is:
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","mx","filename")]);
where filename
is:
- mxcreatecellmatrix.c
- mxcreatecellmatrixf.F
- mxgetinf.c
- mxsetdimensions.c
- mxsetdimensionsf.F
- mxsetnzmax.c
Version History
Introduced before R2006a