| MATLAB® | ![]() |
#include "matrix.h" void mxSetCell(mxArray *pm, mwIndex index, mxArray *value);
mxSetCell(pm, index, value) mwPointer pm, value mwIndex index
Pointer to a cell mxArray
Index from the beginning of the mxArray. Specify the number of elements between the first cell of the mxArray and the cell you want to set. The easiest way to calculate index in a multidimensional cell array is to call mxCalcSingleSubscript.
The new value of the cell. You can put any kind of mxArray into a cell. In fact, you can even put another cell mxArray into a cell.
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 and should not be modified. Using mxSetCell* or mxSetField* 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.
See phonebook.c in the refbook subdirectory of the examples directory. For an additional example, see mxcreatecellmatrix.c in the mx subdirectory of the examples directory.
mxCreateCellArray, mxCreateCellMatrix, mxGetCell, mxIsCell, mxDestroyArray
![]() | mxRemoveField (C and Fortran) | mxSetClassName (C) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |