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

前端 未结 8 1565
逝去的感伤
逝去的感伤 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:33
    mcc -?
    

    explains that the syntax to make *.exe (Standalone Application) with *.m is:

     mcc -m <matlabFile.m> 
    

    For example:

    mcc -m file.m
    

    will create file.exe in the curent directory.

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

    If you have MATLAB Compiler installed, there's a GUI option for compiling. Try entering

    deploytool
    

    in the command line. Mathworks does a pretty good job documenting how to use it in this video tutorial: http://www.mathworks.com/products/demos/compiler/deploytool/index.html

    Also, if you want to include user input such as choosing a file or directory, look into

    uigetfile % or uigetdir if you need every file in a directory
    

    for use in conjunction with

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