User`s guide
6 Standalone Applications
function main
r = mrank(5)
Compiling the Example
To compile these functions into code that can be built into a standalone
applicat ion, invoke MATLAB Compiler.
mcc -m main mrank
The -m option causes MATLAB Com piler to generate C source code suitable for
standalone applications. For example, MATLAB Compiler generates C source
code files
main_main.c and main_mcc_component_data.c. main_main.c
contains a C function named main; main_mcc_component _data.c contains
data needed by the MCR to run the application.
To build an application, you can use
mbuild to compile and link these files.
Or, you can automate the entire build process (invoke MATLAB Compiler on
both M-files, use
mbuild to compile the files with your ANSI C compiler, and
link the code) by using the command
mcc -m main mrank
If you nee d to combine o t he r code with your application (Fo rtran, for example,
a language not suppo rte d b y MATLAB C ompiler), or if you want to build a
makefile that com piles your application, you can use the command
mcc -mc main mrank
The -c option inhibits invocation of mbuild. You will probably need to
examinetheverboseoutputof
mbuild to determine how to set the compiler
options in your makefile. Run
mcc -mv main mrank
to see the switches and options that mbuild uses on your platform.
6-12