Main Content

Package Deployable Archives with Production Server Compiler App

Supported platform: Windows®, Linux®, Mac

This example shows how to create a deployable archive from a MATLAB® function. You can then hand the generated archive to a system administrator who will deploy it into MATLAB Production Server™.

Create Function In MATLAB

In MATLAB, examine the MATLAB program that you want packaged.

For this example, write a function addmatrix.m as follows.

function a = addmatrix(a1, a2)
a = a1 + a2;

At the MATLAB command prompt, enter addmatrix([1 4 7; 2 5 8; 3 6 9], [1 4 7; 2 5 8; 3 6 9]).

The output is:

 ans =
     2     8    14
     4    10    16
     6    12    18

Create Deployable Archive with Production Server Compiler App

  1. On the MATLAB Apps tab, on the far right of the Apps section, click the arrow. In Application Deployment, click Production Server Compiler. In the Production Server Compiler project window, click Deployable Archive (.ctf).

    Production Server Compiler with Deployable Archive (.ctf)type selected and addmatrix.m in the exported functions section

    Alternately, you can open the Production Server Compiler app by entering productionServerCompiler at the MATLAB prompt.

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

    1. In the Exported Functions section of the toolstrip, click .

    2. In the Add Files window, browse to the example folder, and select the function you want to package. Click Open.

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

Customize the Application and Its Appearance

You can customize your deployable archive, and add more information about the application as follows:

  • Archive information — Editable information about the deployed archive.

  • Additional files required for your archive to run — Additional files required by the generated archive to run. These files are included in the generated archive installer. See Manage Required Files in Compiler Project.

  • Files packaged for redistribution — Files that are installed with your application. These files include:

    • Generated deployable archive

    • Generated readme.txt

    See Specify Files to Install with Application

  • Include MATLAB function signature file — Add or create a function signature file to help clients use your MATLAB functions.

Production Server Compiler with the archive name set to addmatrix

Package the Application

  1. To generate the packaged application, click Package.

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

    Package window that says Creating Binaries. The option labeled Open output folder when process completes is checked.

  2. In the Package dialog box, verify that the option Open output folder when process completes is selected.

    When the deployment process is complete, examine the generated output.

    • for_redistribution — A folder containing the installer to distribute the archive.

    • for_testing — A folder containing the raw generated files to create the installer

    • PackagingLog.txt — Log file generated by the packaging tool.

See Also