[GUI to exe] Matlab converts GUI to exe file

       There are many ways to convert GUI files written by yourself into exe files. Let's talk about the method of using deploytool for conversion.

First, use mbuild -setup in the command window to configure a Matlab compiler or something, follow the prompts, select y, and then let you choose the compiler: lcc or Visual C++, choose the corresponding one, as shown below:

 mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
 
Would you like mbuild to locate installed compilers [y]/n? y
 
Select a compiler:
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2008a\sys\lcc
[2] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft Visual Studio
 
[0] None
 
Compiler: 2
 
Please verify your choices:
 
Compiler: Microsoft Visual C++ 6.0
Location: C:\Program Files\Microsoft Visual Studio
 
Are these correct [y]/n? y
 
Trying to update options file: C:\Users\guopanfeng\AppData\Roaming\MathWorks\MATLAB\R2008a\compopts.bat
From template:              C:\PROGRA~1\MATLAB\R2008a\bin\win32\mbuildopts\msvc60compp.bat
 
Done . . .

As shown above: I chose Visual Studio's compiler.

Then you can use deploytool to convert the GUI file into an exe file

Enter deploytool in the command window, and the following appears:

 As shown in the figure above: Then create a new deployment project in the file menu as shown below:

Then select the corresponding options, such as I choose the color settings as shown above, and then save my new prj in Browse.

After creating it, it looks like this:

 Put the main program in the main function, other subprograms in other files, if there is a c program, put it in c/c++ files

Click the setting button as shown below:

 Note here that the folders that do not contain m and c files and the files in them, such as pictures, data, excel, etc., must be placed in the additional files of settings. In this case, these files will be packaged in the package. The folder and the files in it will also be out of the installation directory. If you check Include MATLAB Compiler Runtime, it will also be packaged in, and you will be automatically asked to install MCR when installing on other machines that do not have matlab installed.

Then press in the above picture, Build the project. complete compilation

Then package the project.
Find the proname_pkg.exe file under \distrib is the installation file.

When opening the exe file of distrib, there will be a black box of the Windows system dos, which is not in the way...

Guess you like

Origin blog.csdn.net/ccsss22/article/details/123946901
GUI