Binary MEX files are subroutines produced from C/C++ or Fortran source code. They behave just like MATLAB® scripts and built-in functions. To call a MEX file, use the name of the file, without the file extension. The calling syntax depends on the input and output arguments defined by the MEX file.
To experiment with calling MEX files, use the code in Table of MEX File Source Code Files to build and run examples.
While scripts have a platform-independent extension
.m, MATLAB identifies MEX files by platform-specific extensions. The following table
lists the platform-specific extensions for MEX files.
MEX File Platform-Dependent Extension
|Platform||Binary MEX File Extension|
Apple Mac (64-bit)
You cannot use a binary MEX file on a platform if you compiled it on a different platform. Recompile the source code on the platform for which you want to use the MEX file. For information about using MEX S-functions, see your Simulink® documentation.