mxCreateNumericArray (C)
N-D numeric array
C Syntax
#include "matrix.h" mxArray *mxCreateNumericArray(mwSize ndim, const mwSize *dims, mxClassID classid, mxComplexity ComplexFlag);
Description
Use mxCreateNumericArray
to create an N-dimensional
mxArray
. The data elements have the numeric data type specified by
classid
.
mxCreateNumericArray
differs from mxCreateDoubleMatrix
as follows:
All data elements in
mxCreateDoubleMatrix
are double-precision, floating-point numbers. The data elements inmxCreateNumericArray
can be any numerical type, including different integer precisions.mxCreateDoubleMatrix
creates two-dimensional arrays only.mxCreateNumericArray
can create arrays of two or more dimensions.
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
.
This table shows the C classid
values that are equivalent to
MATLAB classes.
MATLAB Class Name | C |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Call mxDestroyArray
when you finish using the
mxArray
. The mxDestroyArray
function deallocates the
mxArray
and its associated real and imaginary elements.
Input Arguments
Output Arguments
Examples
See these examples in
:matlabroot
/extern/examples/refbook
See these examples in
:matlabroot
/extern/examples/mx
Version History
Introduced before R2006a