mxGetCell (C and Fortran)
Pointer to element in cell array
C Syntax
#include "matrix.h" mxArray *mxGetCell(const mxArray *pm, mwIndex index);
Fortran Syntax
#include "fintrf.h" mwPointer mxGetCell(pm, index) mwPointer pm mwIndex index
Arguments
pm
Pointer to a cell
mxArray
index
Number of elements in the cell
mxArray
between the first element and the desired one. SeemxCalcSingleSubscript
for details on calculating an index in a multidimensional cell array.
Returns
Pointer to the i
th cell mxArray
if successful.
Otherwise, returns NULL
in C (0
in Fortran).
Causes of failure include:
Specifying the index of a cell array element that has not been populated.
Specifying a
pm
that does not point to a cellmxArray
.Specifying an
index
to an element outside the bounds of themxArray
.Insufficient heap space.
Do not call mxDestroyArray
on an mxArray
returned by the mxGetCell
function.
Description
Call mxGetCell
to get a pointer to the mxArray
held in the indexed element of the cell mxArray
.
Note
Inputs to a MEX file are constant read-only mxArray
s. Do not modify the
inputs. Using mxSetCell
*
or
mxSetField
*
functions to modify the cells or
fields of a MATLAB® argument causes unpredictable results.
Examples
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","mex","filename")]);
where filename
is:
See Also
Version History
Introduced before R2006a