Documentation

This is machine translation

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

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

Call MEX File Functions

Call MEX file functions from MATLAB®

A MEX file is a function, created in MATLAB, that calls a C, C++, or Fortran subroutine. To call a MEX file, use the name of the file, without the file extension. The MEX file contains only one function or subroutine, and its name is the MEX file name. The file must be on your MATLAB path.

Functions

mexext Binary MEX file-name extension
inmem Names of functions, MEX-files, classes in memory

Topics

Build MEX File

This example shows how to build the example MEX file, timestwo.

Using MEX Files

MEX files are subroutines created from C/C++ or Fortran source code. They behave just like MATLAB scripts and built-in functions. 

MEX File Placement

Put your MEX file in a folder on the MATLAB path.

Run MEX File You Receive from Someone Else

How to run a MEX file.

Troubleshooting

Version Compatibility

For best results, run MEX files built with your MATLAB version.

Platform Compatibility

If you get a binary MEX file from another source, be sure that the file was compiled for the same platform on which you want to run it.

Invalid MEX File Error

What to do when you get an invalid MEX file error.

Was this topic helpful?