| Contents | Index |
| On this page… |
|---|
MATLAB Compiler compiles a MATLAB application into a standalone application or shared library. The act of compiling this code is sometimes referred to as building.
Building with MATLAB Compiler enables you to run your MATLAB application outside the MATLAB environment. It reduces application development time by eliminating the need to translate your code into a different language.
If you are building a standalone application, MATLAB Compiler produces an executable for your end users. If you integrate into C or C++, MATLAB Compiler provides an interface to use your code as a shared library. If you integrate into other development languages, MATLAB builder products (available separately) let you package your MATLAB applications as software components. You are able to use Java classes, .NET components, or Microsoft® Excel® add-ins.
Note If you are using a non-Windows operating system, "console applications" are referred to as "standalone applications". |
Use MATLAB Compiler to:
Deploy C or C++ code that interfaces with MATLAB
Package MATLAB® applications as executables and shared libraries
Distribute standalone applications and software components, royalty-free
Incorporate MATLAB-based algorithms into applications developed using other languages and technologies
Encrypt your MATLAB code, so that it cannot be viewed or modified
Do not use MATLAB Compiler and builder products for applications shown on the following table. Instead, use the recommended MathWorks product indicated.
| To... | Use... |
|---|---|
| Documentation Set for MATLAB Coder™ |
| MATLAB External Interfaces |
| Deploy Java components into enterprise computing environments and to MATLAB users | MATLAB Builder JA User's Guide |
| Deploy .NET and COM components into enterprise computing environments and to MATLAB users | MATLAB Builder NE User's Guide |
| Deploy Excel add-ins to enterprise computing environments and to MATLAB users | MATLAB Builder EX User's Guide |
You use MATLAB Compiler by running the Deployment Tool GUI (deploytool) from MATLAB or by executing the mcc command.
MATLAB Compiler readies your application for deployment to enterprise computing environments using a combination of generated archives, libraries, and wrapper files.
An application or library generated by MATLAB Compiler consists of a platform-specific binary file and an archive file containing the encrypted MATLAB application and data.
A standalone binary file (also called a standalone executable) consists of a main function.
By contrast, a shared library binary consists of multiple functions for exporting.
MATLAB Compiler generates files. These files provide an interface to your MATLAB code when compiled. The wrapper files and MATLAB code are compiled into platform-specific binary files. Wrapper files differ depending on the execution environment.
The MATLAB Compiler Runtime (MCR) is an engine for execution of compiled MATLAB code.
When you package and distribute applications and libraries that MATLAB Compiler generates, you include the MCR, so your MATLAB code can be run on systems without a licensed version of MATLAB. You set the system paths on the target machine so your application finds the MCR and supporting files.
You have the option to include the MCR with every package generated by the Deployment Tool (deploytool). Include the MCR by clicking Add MCR on the Package tab or download it from the Web. Install it on target machines by running the self-extracting package executable. For more information on the MCR and the MCR Installer, see Distribute MATLAB Code Using the MATLAB Compiler Runtime (MCR)
See the MATLAB Compiler product page for more information about downloading the MCR.
MATLAB Compiler 32-Bit Applications Compatible with Windows 64
Just as you can run 32-bit MATLAB on a 64-bit system, you can create 32-bit executables (EXE or DLL) on a 64-bit system.
Requirements to compile and deploy such executables match the requirements to create a 32-bit application on a 32-bit machine (for example, you need an MCR from a 32-bit version of MATLAB to run a 32-bit application).
For a listing of requirements, see http://www.mathworks.com/support/compilers/current_release/ .
If you are considering porting components created with MATLAB® Compiler™, note the following:
Only Java components can cross platforms. Exceptions are specified here.
Deployment across a 32-bit/64-bit boundary does not work for anything except Java™ components. In other words, deploying from 32-bit Windows® XP to 64-bit Windows XP fails, as would deployment from 64-bit Linux® to 32-bit Linux. However, deployment from one operating system type to another (Windows XP to Windows Vista™, for example) works. The machines must be the same architecture (32-bit or 64-bit) and meet the general system requirements of MATLAB. For example, deployment from 32-bit Windows XP to 32-bit Windows Vista works.
MATLAB code can only be deployed if the toolbox with which it was created is compatible with MATLAB Compiler. MATLAB code generated by certain toolboxes cannot be deployed, usually due to legal, proprietary restrictions.
To determine if your toolbox is compatible, check your toolbox documentation as well as the MATLAB Compiler list of Unsupported MATLAB Functions
For a complete list of what makes MATLAB code deployable or non-deployable, see Limitations About What May Be Compiled and MATLAB Code Deployment in this User's Guide.
![]() | Product Description | MATLAB Compiler Prerequisites | ![]() |

Learn how to build standalone executables and C/C++ shared libraries from MATLAB code.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |