mxCreateLogicalArray (C)
N-D logical array
C Syntax
#include "matrix.h" mxArray *mxCreateLogicalArray(mwSize ndim, const mwSize *dims);
Arguments
ndimNumber of dimensions. If you specify a value for
ndimthat is less than 2,mxCreateLogicalArrayautomatically sets the number of dimensions to 2.dimsDimensions array. Each element in the dimensions array contains the size of the array in that dimension. For example, setting
dims[0]to5anddims[1]to7establishes a5-by-7mxArray. There arendimelements in thedimsarray.
Returns
Pointer to the created mxArray. If unsuccessful in a standalone
(non-MEX file) application, returns NULL. If unsuccessful in a MEX
file, the MEX file terminates and returns control to the MATLAB® prompt. The function is unsuccessful when there is not enough free heap
space to create the mxArray.
Description
Call mxCreateLogicalArray to create an N-dimensional
mxArray of mxLogical elements. After creating
the mxArray, mxCreateLogicalArray initializes
all its elements to logical 0.
mxCreateLogicalArray differs from
mxCreateLogicalMatrix in that the latter can create
two-dimensional arrays only.
mxCreateLogicalArray allocates dynamic memory to store the
created mxArray. When you finish with the created
mxArray, call mxDestroyArray to deallocate
its memory.
MATLAB automatically removes any trailing singleton dimensions specified in the
dims argument. For example, if ndim equals
5 and dims equals [4 1 7 1 1], then
the resulting array has the dimensions
4-by-1-by-7.
Version History
Introduced before R2006a