True if a cell mxArray
C Syntax
#include "matrix.h"
bool mxIsCell(const mxArray *array_ptr);
Arguments
array_ptr
Pointer to an array.
Returns
true
if array_ptr
points to an array having the class mxCELL_CLASS
; otherwise, returns false
.
Description
Use mxIsCell
to determine if the specified array is a cell array.
Do not confuse a cell array with a cell element. Remember that a cell array contains various cell elements, and that most cell elements are not cell arrays.
Examples
Consider a MEX-file that expects its first input argument to be a cell array. If it is not a cell array, the MEX-file issues an error message.
void
mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray
*prhs[])
{
if (mxIsCell(prhs[0])) {
/* ... Yes, it is a cell array. */
}
else /* No, this is not a cell array. */
mexErrMsgTxt("You must specify a cell array.");
}
For an additional example, see mxiscell.c
in the mx
subdirectory of the examples
directory.
See Also
mxIsClass
[ Previous | Help Desk | Next ]