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.
This example shows how to generate a C executable from MATLAB® code using the MATLAB Coder™ app. In this example, you generate an executable for a MATLAB function that generates a random scalar value. Using the app, you: Generate a an example C main function that calls the generated library function.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With