Make array persist after MEX file completes
#include "mex.h" void mexMakeArrayPersistent(mxArray *pm);
#include "fintrf.h" subroutine mexMakeArrayPersistent(pm) mwPointer pm
pm
Pointer to an mxArray
created by an mxCreate
*
function
By default, an mxArray
allocated by an mxCreate
*
function is not persistent. The MATLAB® memory management facility
automatically frees a nonpersistent mxArray
when
the MEX function finishes. If you want the mxArray
to
persist through multiple invocations of the MEX function, call the mexMakeArrayPersistent
function.
Do not assign an array created with the mexMakeArrayPersistent
function
to the plhs
output argument of a MEX file.
Note
If you create a persistent |
mexAtExit
, mxDestroyArray
, mexLock
, mexMakeMemoryPersistent
,
and the mxCreate
* functions