Documentation Center

  • Trials
  • Product Updates

mxDestroyArray (C and Fortran)

Free dynamic memory allocated by MXCREATE* functions

C Syntax

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

Fortran Syntax

subroutine mxDestroyArray(pm)
mwPointer pm

Arguments

pm

Pointer to the mxArray 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 in a left side argument.

Examples

See the following examples in matlabroot/extern/examples/refbook.

See the following examples in matlabroot/extern/examples/mex.

See the following examples in matlabroot/extern/examples/mx.

Was this topic helpful?