Supported platform: Windows®
This example shows how to create a deployable archive with Excel® integration from a MATLAB® function. You can then give the generated archive to a system administrator to deploy on MATLAB Production Server™.
In MATLAB, examine the MATLAB program that you want to package.
For this example, write a function mymagic.m
as follows.
function y = mymagic(x)
y = magic(x);
At the MATLAB command prompt, enter mymagic(3)
.
The output is:
ans = 8 1 6 3 5 7 4 9 2
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 with Excel integration.
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 files 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.
Click Open.
The function mymagic.m
is added to the list of main
files.
You can customize your deployable archive with Excel integration, and add more information about the application as follows:
Archive information — Editable information about the deployed archive with Excel integration.
Client configuration — Configure the MATLAB
Production Server client. Select the Default Server URL, decide
wait time-out, and maximum size of response for the client, and provide an
optional self-signed certificate for https
.
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 installed with your archive — Files that are installed with your archive on the client and server. The files installed on the server include:
Generated deployable archive (.ctf)
Generated readme.txt
The files installed on the client include:
mymagic.bas
mymagic.dll
mymagic.xla
readme.txt
ServerConfig.dll
Options — The option Register the resulting component for you only on the development machine exclusively registers the packaged component for one user on the development machine.
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 the
installer to distribute the archive on the MATLAB
Production Server client and server
for_redistribution_files_only
— Folder
containing the files required for redistributing the application on the
MATLAB
Production Server client and server
for_testing
— Folder containing the raw
generated files to create the installer
PackagingLog.txt
— Log file generated by
MATLAB
Compiler™
The archive must be deployed to a MATLAB Production Server instance before the add-in works.
To install the deployable archive on a server instance:
Locate the archive in the
for_redistribution_files_only\server\
folder.
The file name is similar to
.archiveName
.ctf
Copy the archive file to the auto_deploy
folder of the
server instance. The server instance automatically deploys it and makes it
available to interested clients.
For more information, see MATLAB Production Server documentation.