Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

mxSetCell (C and Fortran) - Set value of one cell of mxArray

C Syntax

#include "matrix.h"
void mxSetCell(mxArray *pm, mwIndex index, mxArray *value);

Fortran Syntax

mxSetCell(pm, index, value)
mwPointer pm, value
mwIndex index

Arguments

pm

Pointer to a cell mxArray

index

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.

value

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.

Description

Call mxSetCell to put the designated value into a particular cell of a cell mxArray.

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.

C Examples

See phonebook.c in the matlabroot/extern/examples/refbook folder . For an additional example, see mxcreatecellmatrix.c in the matlabroot/extern/examples/mx folder .

See Also

mxCreateCellArray, mxCreateCellMatrix, mxGetCell, mxIsCell, mxDestroyArray

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS