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

前端 未结 8 1564
逝去的感伤
逝去的感伤 2020-11-30 04:46

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

相关标签:
8条回答
  • 2020-11-30 05:12

    It used to be possible to compile Matlab to C with older versions of Matlab. Check out other tools that Matlab comes with.

    Newest Matlab code can be exported as a Java's jar or a .Net Dll, etc. You can then write an executable against that library - it will be obfuscated by the way. The users will have to install a freely available Matlab Runtime.

    Like others mentioned, mcc / mcc.exe is what you want to convert matlab code to C code.

    0 讨论(0)
  • 2020-11-30 05:14

    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.

    0 讨论(0)
  • 2020-11-30 05:16

    If your code is more of a data analysis routine (vs. visualization / GUI), try GNU Octave. It's free and many of its functions are compatible with MATLAB. (Not 100% but maybe 99.5%.)

    0 讨论(0)
  • 2020-11-30 05:20

    Try:

    mcc -m yourfile
    

    Also see help mcc

    0 讨论(0)
  • 2020-11-30 05:24

    The "StandAlone" method to compile .m file (or files) requires a set of Matlab published library (.dll) files on a target (non-Matlab) platform to allow execution of the compiler generated .exe.

    Check MATLAB main site for their compiler products and their limitations.

    0 讨论(0)
  • 2020-11-30 05:26

    I developed a non-matlab software for direct compilation of m-files (TMC Compiler). This is an open-source converter of m-files projects to C. The compiler produces the C code that may be linked with provided open-source run-time library to produce a stand-alone application. The library implements a set of build-in functions; the linear-algebra operations use LAPACK code. It is possible to expand the set of the build-in functions by custom implementation as described in the documentation.

    0 讨论(0)
提交回复
热议问题