This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Handle 8-, 16-, 32-, and 64-Bit Data

The MATLAB® API provides a set of functions that support signed and unsigned 8-, 16-, 32-, and 64-bit data. For example, the mxCreateNumericArray function constructs an unpopulated N-dimensional numeric array with a specified data size. For more information, see mxClassID.

Once you have created an unpopulated MATLAB array of a specified data type, you can access the data using the typed data access functions, like mxGetInt8s and mxGetComplexInt8s. You can perform arithmetic on data of 8-, 16-, 32-, or 64-bit precision in MEX files. MATLAB recognizes the correct data class of the result.

The example doubleelement.c constructs a 2-by-2 matrix with unsigned 16-bit integers, doubles each element, and returns both matrices to MATLAB.

To build this example, at the command prompt type:

mex -R2017b doubleelement.c

Call the example.

ans =
     2     6
     4     8

The output of this function is a 2-by-2 matrix populated with unsigned 16-bit integers.

See Also

| | |

Related Topics