How can I distribute an application that is developed using MATLAB?

43 views (last 30 days)
I would like to distribute the MATLAB code that I have developed. What are some ways to package and distribute this code as an application to users who do not have MATLAB?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Feb 2012
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:
deploytool
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
  4 Comments
Walter Roberson
Walter Roberson on 15 Oct 2015
No, applications must be created on the operating system class they are to run on. The exception to this is that you can use a 64 bit version of MS Windows to create a .exe to run on a 32 bit version of MS Windows.
Walter Roberson
Walter Roberson on 29 Dec 2016
No, the java that is created uses JNI to call platform-specific libraries.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB Compiler SDK in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2011b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!