mxSetCell (C and Fortran)
Set contents of cell array
C Syntax
#include "matrix.h" void mxSetCell(mxArray *pm, mwIndex index, mxArray *value);
Fortran Syntax
#include "fintrf.h" subroutine mxSetCell(pm, index, value) mwPointer pm, value mwIndex index
Arguments
pmPointer to a cell
mxArrayindexIndex from the beginning of the
mxArray. Specify the number of elements between the first cell of themxArrayand the cell you want to set. The easiest way to calculateindexin a multidimensional cell array is to callmxCalcSingleSubscript.valuePointer to new value for the cell. You can put an
mxArrayof any type into a cell. You can even put another cellmxArrayinto a cell.
Description
Call mxSetCell to put the designated value
into a particular cell of a cell mxArray.
Note
Inputs to a MEX file are constant read-only mxArrays. Do not modify the
inputs. Using mxSetCell* or
mxSetField* functions to modify the cells or
fields of a MATLAB® argument causes unpredictable results.
This function does not free any memory allocated for existing data that it displaces.
To free existing memory, call mxDestroyArray on the pointer
returned by mxGetCell before you call
mxSetCell.
Examples
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","refbook","filename")]);
where filename is:
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","mx","filename")]);
where filename is:
Version History
Introduced before R2006a