This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mxDestroyArray (C)

Free dynamic memory allocated by MXCREATE* functions

C Syntax

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


mxDestroyArray deallocates memory for the specified mxArray including:

  • Characteristics fields of the mxArray, such as size (m and n) and type

  • Associated data arrays, such as ir and jc for sparse arrays

  • Fields of structure arrays

  • Cells of cell arrays

Do not call mxDestroyArray on an mxArray:

  • Returned in a left-side argument of a MEX file

  • Returned by the mxGetField or mxGetFieldByNumber functions

  • Returned by the mxGetCell function

Input Arguments

expand all

Pointer to the mxArray to free, specified as mxArray *. If pm is a NULL pointer, then the function does nothing.


See these examples in matlabroot/extern/examples/refbook:

See these examples in matlabroot/extern/examples/mex:

See these examples in matlabroot/extern/examples/mx:

Introduced before R2006a