mxGetElementSize (Fortran)
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 Compatibility Considerations.
Fortran Syntax
#include "fintrf.h" mwPointer mxGetElementSize(pm) mwPointer 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.
Input Arguments
Output Argumentsoption), then the function returns the number of bytes for the data type of the array regardless whether the array is complex or real.
If you build with the interleaved complex API (
mex
-R2018aoption), then the return value is twice the number of bytes for the data type.
If
pm points to a cell or structure, then
mxGetElementSize returns the size of a pointer. The
function does not return the size of all the elements in each cell or
structure field.
Returns 0 on failure. The primary reason for failure is that
pm points to an
mxArray having an
unrecognized class.