Supported platform: Windows®, Linux®, Mac
This example shows how to create a deployable archive from a MATLAB® function. You can then give the generated archive to a system administrator to deploy it on the MATLAB Production Server™ environment.
In MATLAB, examine the MATLAB program that you want to package.
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
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 MATLAB Compiler SDK project window, click Deployable Archive (.ctf).
Alternatively, you can open the Production Server
Compiler app by entering
productionServerCompiler at the MATLAB prompt.
In the MATLAB Compiler SDK project window, specify the main file of the MATLAB application that you want to deploy.
In the Exported Functions section, click .
In the Add Files window, browse to the example folder, and select the function you want to package.
addmatrix.m is added to the list of main
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 to run the generated archive. 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 archive. These files include:
Generated deployable archive
Include MATLAB function signature file — Add or create a function signature file to help clients use your MATLAB functions. See MATLAB Function Signatures in JSON.
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 deployment process is complete, examine the generated output.
for_redistribution — Folder containing
for_testing — Folder containing the
raw generated files to create the installer
PackagingLog.txt — Log file generated