Create Standalone Application from MATLAB Function Using Application Compiler App
This example shows how to use the Application Compiler app in MATLAB® Compiler™ to package a MATLAB function into a standalone application. Alternatively, if you want to create a standalone application from the MATLAB command window using a programmatic approach, see Create Standalone Application from MATLAB Function.
On the MATLAB Apps tab, on the far right of the Apps section, click the arrow. In Application Deployment, click Application Compiler.
Alternately, you can open the Application Compiler app by entering
applicationCompilerat the MATLAB prompt.
In the MATLAB Compiler project window, specify the main file of the MATLAB application that you want to deploy.
In the Main File section of the toolstrip, click .
In the Add Files window, browse to
magicsquare.m. Click Open.
magicsquare.mis added to the list of main files.
Decide whether to include the MATLAB Runtime installer in the generated application by selecting one of the two options in the Packaging Options section:
Runtime downloaded from web — Generates an installer that downloads the MATLAB Runtime and installs it along with the deployed MATLAB application.
Runtime included in package — Generates an installer that includes the MATLAB Runtime installer.
Customize the packaged application and its appearance:
Application information — Editable information about the deployed application. You can also customize the standalone applications appearance by changing the application icon and splash screen. The generated installer uses this information to populate the installed application metadata. See Customize the Installer.
Command line input type options — Selection of input data types for the standalone application. For more information, see Determine Data Type of Command-Line Input (For Packaging Standalone Applications Only).
Additional installer options — Edit the default installation path for the generated installer and selecting custom logo. See Change the Installation Path.
Files required for your application to run — Additional files required by the generated application to run. These files are included in the generated application installer. See Manage Required Files in Compiler Project.
Files installed for your end user — Files that are installed with your application. These files include:
Generated executable for the target platform
Additional runtime settings — Platform-specific options for controlling the generated executable. See Additional Runtime Settings.
On Windows® operating systems, when creating a console only application, uncheck the box Do not display the Windows Command Shell (console) for execution. By default, this box is checked. If the box is checked, output from your console only application is not displayed. Since this example is a console only application, the box must be unchecked.
To generate the packaged application, click Package.
In the Save Project dialog box, specify the location to save the project.
In the Package dialog box, verify that Open output folder when process completes is selected.
When the packaging process is complete, examine the generated output.
Three folders are generated in the target folder location:
For further information about the files generated in these folders, see Files Generated After Packaging MATLAB Functions.
PackagingLog.html— Log file generated by MATLAB Compiler.
To install your standalone application, see Install Deployed Application.