User`s guide

Coding with M-Files Only
4-37
The -m option flag causes the MATLAB Compiler to generate C source code
suitable for stand-alone applications. For example, the MATLAB Compiler
generates C source code files
main.c, main_main.c, and mrank.c. main_main.c
contains a C function named
main; main.c and mrank.c contain a C functions
named
mlfMain and mlfMrank. (The -c option flag inhibits invocation of
mbuild.)
To build an executable application, you can use
mbuild to compile and link
these files. Or, you can automate the entire build process (invoke the MATLAB
Compiler twice, use
mbuild to compile the files with your ANSI C compiler, and
link the code) by using the command
mcc -m main mrank
Figure 4-2, Building Two M-Files into a Stand-Alone C Application, illustrates
the process of building a stand-alone C application from two M-files. The
commands to compile and link depend on the operating system being used. See
Building Stand-Alone C/C++ Applications on page 4-4 for details.