mxGetElementSize (C)
Number of bytes required to store each data element
For a complex mxArray
built with the interleaved complex API,
mxGetElementSize
returns twice the value that the function in the
separate complex API returns. For more information, see Version History.
C Syntax
#include "matrix.h" size_t mxGetElementSize(const mxArray *pm);
Description
Call mxGetElementSize
to determine the number of bytes in each
data element of the mxArray
. For example, if the MATLAB® class of an mxArray
is int16
, the
mxArray
stores each data element as a 16-bit (2-byte) signed
integer. Thus, mxGetElementSize
returns
2
.
mxGetElementSize
is helpful when using a non-MATLAB routine to manipulate data elements. For example, the C function
memcpy
requires the size of the elements you intend to
copy.