Main Content

Web App Compiler

Package MATLAB programs for deployment as web apps

Since R2025a

Description

The Web App Compiler packages MATLAB® programs into web applications that can run on MATLAB Web App Server™. The interactive menus and dialog boxes used in the compiler apps build compiler.build commands that are customized to your specification.

Compiler app advantages include:

  • You can perform deployment tasks with a single intuitive interface.

  • You can organize your files in a MATLAB project.

  • Your project state persists between sessions.

  • You can load previously stored compiler tasks from a prepopulated menu.

  • You can package applications with an installer for distribution.

For more information, see Target-Specific Compiler Apps for MATLAB Code Deployment.

Open the Web App Compiler App

  • MATLAB toolstrip: On the Apps tab, under Application Deployment, click the app icon.

  • MATLAB command prompt: Enter webAppCompiler.

Parameters

expand all

Main File

File implementing MATLAB functions. Files must have one of the following extensions: .m, .p, .mlx, or .mexa64.

All files must be located in the project root folder to be added to the project. To add MATLAB functions to the deployable archive., click Add Main File and select your MATLAB file. In the Project panel, the file you selected gains the labels Design and Main File.

Output Location

Path to folder where the web app is generated.

Build Settings

Name of the generated web app. The default value is MyWebAppArchive.

Obfuscate folder structures, file names, and user code in the deployable archive.

If you enable this property, then folder structures and file names in the deployable archive are obfuscated from the end user, and user code and data contained in .m, .mlapp, .p, .mat, MLX, SFX, and MEX files are placed into a user package within the archive. Additionally, all .m files are converted to P-files before packaging.

During runtime, MATLAB code and data is decrypted and loaded directly from the user package rather than extracted to the file system. MEX files are temporarily extracted from the user package before being loaded.

To manually include additional file types in the user package, add each file type in a separate extension tag to the file matlabroot/toolbox/compiler/advanced_package_supported_files.xml.

The following are not supported:

  • ver function

  • Calling external libraries such as DLLs

  • Out-of-process MATLAB Runtime (C++ shared library for MATLAB Data Array)

  • Out-of-process MEX file execution (mexhost, feval, matlab.mex.MexHost)

  • Before R2023b: .mat files other than v7.3

Enabling this option is equivalent to using mcc with -j and -s specified.

If you do not enable this property, then the deployable archive is not obfuscated. This is the default behavior.

Files Required for Archive to Run

Support packages to include in the deployable archive. The dependency analysis process detects and includes the required support packages automatically. Only the specified support packages are included. To list installed support packages or those used by a specific file, see compiler.codetools.deployableSupportPackages.

Additional files and folders to include in the deployable archive. To add the contents of a folder, click Add Folder. To add an individual file, click Add File.

Additional files to include in the deployable archive. The dependency analysis process detects and includes required data files automatically unless Automatically include data files that are provided as inputs to functions such as load and fopen is disabled.

To view the file analysis results, click View Analysis. To perform the dependency analysis process again, click Reanalyze.

Automatically include data files in the deployable archive.

  • If you enable this property, then data files that you provide as inputs to certain functions (such as load and fopen) are automatically included in the deployable archive. This is the default option.

  • If you disable this property, then you must add data files to the package in the Custom Requirements section.

Web App Info

Web app information. This section contains a display image and the web app name, author, summary, and version.

To modify the app using App Designer, click Edit App Details.

Version History

Introduced in R2025a

expand all