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™.
In MATLAB, examine the MATLAB program that you want packaged.
For this example, write a function
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).
Alternately, you can open the Production
Server Compiler app by entering
productionServerCompiler at the
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 of the toolstrip, click .
In the Add Files window, browse to the example folder, and select the function you want to package. Click Open.
addmatrix.m is added
to the list of main files.
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
Include MATLAB function signature file — Add or create a function signature file to help clients use your MATLAB functions.
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 the option Open output folder when process completes is selected.
When the deployment process is complete, examine the generated output.
— A folder containing the installer to
distribute the archive.
for_testing — A
folder containing the raw generated files to
create the installer
Log file generated by the packaging tool.