Thursday, December 18, 2014

How to generate .exe file from .m file?

Q) How to Generate an windows executable file (.exe) from a MATLAB script file (.m)?
Ans)

This process of converting non-executable files to executable/sub-executable files is called mexing.

MATLAB is supporting this mexing process, by its MATLAB COMPILER. The MATLAB COMPILER license is required to work with it.

MEXING PROCESS:
Go to the Command Window of MATLAB, and type

mex setup
mcc -m  filename.m 
               % this command generates a .exe file
ls filenae
! cmd &
exit


If the corresponding .dll file must be generated, use the same process listed above, replacing the second line with

mcc -l filename.m
               % this instruction generates a .dll file




Apart from these, MATLAB COMPILER can also generate .hdl file.