External Interfaces/API Reference    
mexMakeMemoryPersistent

Make memory allocated by MATLAB's memory allocation routines (mxCalloc, mxMalloc, mxRealloc) persist after the MEX-file completes

C Syntax

Arguments
ptr
   Pointer to the beginning of memory allocated by one of MATLAB's memory allocation routines.

Description

By default, memory allocated by MATLAB is nonpersistent, so it is freed automatically when the MEX-file finishes. If you want the memory to persist, you must call mexMakeMemoryPersistent.

See Also

mexAtExit, mexLock, mexMakeArrayPersistent, mxCalloc, mxFree, mxMalloc, mxRealloc


 mexMakeArrayPersistent mexPrintf