Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

C MEX Files

Build MATLAB® functions from C/C++ functions

Call your own C or C++ programs from the MATLAB command line as if they were built-in functions. These programs are called MEX files and the function name is the MEX file name.

Write your programs using the MATLAB API libraries — MEX Library and the C Matrix Library. The functions in these libraries facilitate the transfer of data between MEX files and the workspace. Build the source file into an executable program using the mex function. You can also share the MEX file with other MATLAB users.

If you want to call MATLAB functions from C or C++ programs, use the MATLAB API for C engine library functions.

Was this topic helpful?