Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

mxDestroyArray (C and Fortran) - Free dynamic memory allocated by mxCreate* functions

C Syntax

#include "matrix.h"
void mxDestroyArray(mxArray *pm);

Fortran Syntax

mxDestroyArray(pm)
mwPointer pm

Arguments

pm

Pointer to the mxArray you want to free

Description

mxDestroyArray deallocates the memory occupied by the specified mxArray. mxDestroyArray not only deallocates the memory occupied by the mxArray's characteristics fields (such as m and n), but also deallocates all the mxArray's associated data arrays, such as pr and pi for complex arrays, ir and jc for sparse arrays, fields of structure arrays, and cells of cell arrays. Do not call mxDestroyArray on an mxArray you are returning on the left-hand side.

C Examples

See sincall.c in the matlabroot/extern/examples/refbook folder .

Additional examples:

See Also

mxCalloc, mxMalloc, mxFree, mexMakeArrayPersistent, mexMakeMemoryPersistent

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS