MEX Compile MEX-function Usage: mex [options ...] file [files ...] Description: MEX compiles and links source files into a shared library called a MEX-file, executable from within MATLAB. It also builds executable files for standalone MATLAB engine and MAT-file applications. Command Line Options Available on All Platforms: -c Compile only. Creates an object file but not a MEX-file. -client engine Build standalone MATLAB engine or MAT-file application. -compatibleArrayDims Build a MEX-file using the MATLAB Version 7.2 array-handling API, which limits arrays to 2^31-1 elements. This option is the default, but in the future the -largeArrayDims option will be the default. -D Define a symbol name to the C preprocessor. Equivalent to a "#define " directive in the source. Do not add a space after this switch. -D= Define a symbol name and value to the C preprocessor. Equivalent to a "#define " directive in the source. Do not add a space after this switch. -f For advanced users. Specify location and name of the MEX configuration file to use. Overrides MEX's default compiler selection mechanism. -g Create a MEX-file containing additional symbolic information for use in debugging. This option disables MEX's default behavior of optimizing built object code (see the -O option). -h[elp] Display this message. -I Add to the list of directories to search for #include files. Do not add a space after this switch. -l Link with object library. On Windows, expands to ".lib" or "lib.lib". On Linux, to "lib.so". On Mac, to "lib.dylib". Do not add a space after this switch. -L Add to the list of folders to search for libraries specified with the -l option. Do not add a space after this switch. -largeArrayDims Build a MEX-file using the MATLAB large-array-handling API. This API can handle arrays with more than 2^31-1 elements when compiled on 64-bit platforms. -compatibleArrayDims is the default option. -n No execute mode. Display commands that MEX would otherwise have executed, but do not actually execute any of them. -O Optimize the object code. Optimization is enabled by default and by including this option on the command line. If the -g option appears without the -O option, optimization is disabled. -outdir Place all output files in folder . -output Create MEX-file named . The appropriate MEX-file extension is automatically appended. Overrides MEX's default MEX-file naming mechanism. -setup Change the default compiler to build language MEX-files. When this option is specified, no other command line input is accepted. -silent Suppress informational messages. The mex function still reports errors and warnings, even when you specify -silent. -U Remove any initial definition of the C preprocessor symbol . (Inverse of the -D option.) Do not add a space after this switch. -v Verbose mode. Display the values for important internal variables after all command line arguments are considered. Displays each compile step and final link step fully evaluated. = Override default setting for variable . This option is processed after all command line arguments are considered. Command Line Options Available Only on Windows Platforms: @ Include contents of the text file as command line arguments to MEX. For more information, see http://www.mathworks.com/help/matlab/ref/mex.html