Then some examples
Make a C translation and a MEX-file for myfun.m:
mcc -x myfun
Make a C translation and a stand-alone executable for myfun.m:
mcc -m myfun
Make a C++ translation and a stand-alone executable for myfun.m:
mcc -p myfun
Make a C translation and a Simulink S-function for myfun.m
(using dynamically sized inputs and outputs):
mcc -S myfun
Make a C translation and a Simulink S-function for myfun.m
(explicitly calling for one input and two outputs):
mcc -S -u 1 -y 2 myfun
Make a C translation and stand-alone executable for myfun.m. Look for
myfun.m in the directory /files/source, and put the resulting C files and
executable in the directory /files/target:
mcc -m -I /files/source -d /files/target myfun
Make a C translation and a MEX-file for myfun.m. Also translate and include
all M-functions called directly or indirectly by myfun.m. Incorporate the
full text of the original M-files into their corresponding C files as C
comments:
mcc -x -h -A annotation:all myfun
Make a generic C translation of myfun.m:
mcc -t -L C myfun
Make a generic C++ translation of myfun.m:
mcc -t -L Cpp myfun
Make a C MEX wrapper file from myfun1.m and myfun2.m:
mcc -W mex -L C myfun1 myfun2
Make a C translation and a stand-alone executable from myfun1.m and myfun2.m
(using one mcc call):
mcc -m myfun1 myfun2
Make a C translation and a stand-alone executable from myfun1.m and myfun2.m
(by generating each output file with a separate mcc call):
mcc -t -L C myfun1 % yields myfun1.c
mcc -t -L C myfun2 % yields myfun2.c
mcc -W main -L C myfun1 myfun2 % yields myfun1_main.c
mcc -T compile:exe myfun1.c % yields myfun1.o
mcc -T compile:exe myfun2.c % yields myfun2.o
mcc -T compile:exe myfun1_main.c % yields myfun1_main.o
mcc -T link:exe myfun1.o myfun2.o myfun1_main.o
Note: on PCs, filenames ending with .o above would actually end with .obj.
.