Main Content

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.

  1. On the MATLAB Apps tab, on the far right of the Apps section, click the arrow. In Application Deployment, click Application Compiler.

    Library Compiler app header

    Alternately, you can open the Application Compiler app by entering applicationCompiler at the MATLAB prompt.

  2. In the MATLAB Compiler project window, specify the main file of the MATLAB application that you want to deploy.

    1. In the Main File section of the toolstrip, click .

    2. In the Add Files window, browse to matlabroot\extern\examples\compiler and select magicsquare.m. Click Open.

      The function magicsquare.m is added to the list of main files.

  3. 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.

  4. Customize the packaged application and its appearance:

    Application Compiler app with application name magicsquare

    • Application information — Editable information about the deployed application. You can also customize the standalone applications appearance by changing the application icon and splash screen. Custom splash screens are not supported on Mac systems. The generated installer uses this information to populate the installed application metadata. For more details, 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 readme.txt

      • Generated executable for the target platform

      See Specify Files to Install with Application.

    • Additional runtime settings — Platform-specific options for controlling the generated executable. See Additional Runtime Settings.

      Caution

      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.

  5. To generate the packaged application, click Package.

    In the Save Project dialog box, specify the location to save the project.

  6. 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_redistribution, for_redistribution_files_only, and for_testing.

      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.

  7. To install your standalone application, see Install Deployed Application.

See Also

| |

Related Topics