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.

mxArray (C)

Type for MATLAB array


The fundamental type underlying MATLAB® data. For information on how the MATLAB array works with MATLAB-supported variables, see MATLAB Data.

mxArray is a C language opaque type.

All C MEX files start with a gateway routine, called mexFunction, which requires mxArray for both input and output parameters. For information about the C MEX file gateway routine, see Components of MEX File.

Once you have MATLAB data in your MEX file, use functions in the C Matrix API to manipulate the data and functions in the C MEX API to perform operations in the MATLAB environment. Use mxArray to pass data to and from these functions.

Use any of the mxCreate* functions to create data, and the corresponding mxDestroyArray function to free memory.

The header file containing this type is:

#include "matrix.h"


See these examples in matlabroot/extern/examples/mx:


Introduced before R2006a