How to create an executable .exe file from a .m file

AP. picture AP. · Dec 18, 2009 · Viewed 122.5k times · Source

I was wondering if there is a way to create a '.exe' file from ' .m' file in MATLAB, such that it can be run in machine which does not have MATLAB (like it can be done in C, C++).

I know writing a MATLAB function is one way, but I am not sure if it can run in machine without MATLAB.

Also I would like to hide my code and just create a script which can be run by a user using his own data files.

Answer

phoebus picture phoebus · Dec 18, 2009

The Matlab Compiler is the standard way to do this. mcc is the command. The Matlab Runtime is required to run the programs; I'm not sure if it can be directly integrated with the executable or not.