Section 1: Overview of Deployment Options
MATLAB® deployment products convert MATLAB programs into applications and components that you can distribute to end users who do not have MATLAB installed. Deployed applications run as MATLAB code against a set of supporting MATLAB libraries called the MATLAB Component Runtime (MCR). The deployment products generate wrapper code to allow your MATLAB application to run as a stand-alone executable or interact with other technologies, but your application remains in MATLAB code. Thus, the execution time of deployed code will be almost identical to the execution time in MATLAB.
You can deploy MATLAB applications as:
Stand-alone executables using MATLAB Compiler™
C or C++ libraries using MATLAB Compiler™
Java classes using MATLAB Builder™ JA
Microsoft .NET or COM components using MATLAB Builder™ NE
Microsoft Excel add-ins using MATLAB Builder™ EX
All deployed components and applications can be distributed free of charge. The deployment products support the MATLAB language, most MATLAB toolboxes, and user-developed GUIs.
Section 2: How Does the MATLAB® Compiler™ Work
You can create deployable applications and components either by using the command line MCC command or by using the Deployment Tool Graphical User Interface.
An application or component generated by MATLAB Compiler™ has two parts: a platform-specific binary file and an archive file containing MATLAB functions and data. For an application, the binary file consists of a main function, and for a library the binary file exports multiple functions that can be called by users of the library. The wrapper file provides an interface to the compiled MATLAB code. Wrapper files differ depending on the execution environment. The archive file, called a Component Technology File. which is named with a .ctf suffix, contains the MATLAB functions and data that define the application or library.
Any application or component created from the same version of MATLAB can then run against the same MCR – it is not necessary to distribute a new MCR with each update of your application or component.
Section 3: Deployment Tool Workflow
Open the Deployment Tool by issuing the following command at the MATLAB prompt:
Use the Deployment Tool as follows to create and package either a standalone application or a shared library:
(a) Create a new project.
(b) Add files that you want to compile.
(c) Set properties for building and packaging.
(d) Save the project.
(e) Build the component.
(f) Test, edit and rebuild as necessary.
(g) Package the component for distribution to programmers or end users.
For more information on the mcc command, consult the MATLAB documentation.
Section 4: Deploying with the Compiler
You need three main components when distributing your application:
(a) The component wrapper or application wrapper you have created (for example, .exe or .dll)
(b) The archive file containing all of the MATLAB code used in your component or application – this is called the CTF (Component Technology File) and has the extension .ctf
(c) The MCR
You may use the package option in the Deployment Tool to package the wrapper, archive, and, optionally, the MCR into a single zip file for distribution.
Section 5: What If All Else Fails?
If you have tried all of the above steps and are still having trouble distributing your application, use this form to contact technical support. Be sure to include the following:
(a) The version of MATLAB you are using
(b) The system path of the target machine
(c) The name of the directory where the run-time libraries are installed
(d) The exact error message