Convert any of your .m files (MATLAB Script Files) into stand alone applications (.exe) Through mcc: MATLAB Compiler

Yes, you can convert any of your .m files (MATLAB Script Files) into stand alone applications (.exe) using the command "mcc".
"mcc" is the MATLAB command that invokes the MATLAB Compiler. You can issue the "mcc" command either from the MATLAB command prompt (MATLAB mode) or the DOS or UNIX command line (standalone mode). Means it is a separate entity with respect of MATLAB & can be invoked through MATLAB or any other system terminal.

General syntax of "mcc" command is:

mcc [-options] mfile1       [mfile2 ... mfileN]
                            [C/C++file1 ... C/C++fileN] 
 
So, one thing that might come to mind that, what is the benefit of doing it? Well the answer to this is simple, now you can still run your MATLAB Script files without having Matlab installed in your system.

A test case for "mcc".
Suppose you have a MATLAB script file known as xyz.m, that you want to export as an executable. So you will type the command as, "mcc -m calculator.m". You can explore more by typing "help mcc"
The parameter "-m" will generate a  Stand-alone C application, if you want to generate a C++ application you just need to change this parameter as "-p".

Along with the generated .exe (Executable) file mcc will generate some additional files, in the same folder, & they will be like: 
asv file(s)
prg file(s)
c files(s)
log files
txt files

NOTE
You need to have MATLAB Runtime pre-installed in the destination system, in which you planned to deploy this .exe file.

IMPORTANT
MCC (MATLAB Compiler) doesn't generally a part of MATLAB. You need to most probably purchase it as separate entity.

0 comments: