| MATLAB Compiler | ![]() |
Compiling the M-File into a MEX-File
To create a MEX-file from this M-file, enter the mcc command at the MATLAB interpreter prompt.
mcc -x gasket
.c containing MEX-file C source code..h containing the public information._mex.c containing the MEX-function interface (MEX wrapper).gasket.mex. (The actual filename extension of the executable MEX-file varies depending on your platform, e.g., on the PC the file is named gasket.dll.)mcc automatically invokes mex to create gasket.mex from gasket.c and gasket_mex.c. The mex utility encapsulates the appropriate C compiler and linker options for your system.
This example uses the -x macro option to create the MEX-file. For more information on this Compiler option as well as the other options, see the mcc reference page. For more information on the files that the Compiler generates, see Chapter 5, Controlling Code Generation.
| Invoking the M-File | Invoking the MEX-File | ![]() |