Skip to Main Content Skip to Search
Product Documentation

Product Overview

What is MATLAB Compiler?

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.

When To Use MATLAB Compiler

Use MATLAB Compiler to:

When Not To Use MATLAB Compiler

Do not use MATLAB Compiler and builder products for applications shown on the following table. Instead, use the recommended MathWorks product indicated.

To...Use...
  • Generate readable, efficient, and embeddable C code from MATLAB code

  • Generate MEX functions from MATLAB code for rapid prototyping and verification of generated C code within MATLAB

  • Integrate MATLAB code into Simulink®

  • Speed up fixed-point MATLAB code

  • Generate hardware description language (HDL) from MATLAB code

Documentation Set for MATLAB Coder™
  • Integrate custom C code into MATLAB with MEX files

  • Call MATLAB from C and Fortran programs

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

How Do I Use This Product?

You use MATLAB Compiler by running the Deployment Tool GUI (deploytool) from MATLAB or by executing the mcc command.

How Does This Product Work?

MATLAB Compiler readies your application for deployment to enterprise computing environments using a combination of generated archives, libraries, and wrapper files.

Standalone Applications and Shared Libraries

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.

Wrapper Files

wrapper

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.

MATLAB Compiler-generated Applications and the MATLAB Compiler Runtime (MCR)

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.

Limitations and Restrictions

MATLAB Compiler 32-Bit Applications Compatible with Windows 64

Architecture Compatibility

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/ .

Cross-Platform Considerations

If you are considering porting components created with MATLAB® Compiler™, note the following:

Limitations on Deployability

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.

  


Free MATLAB Compiler Interactive Kit

Learn how to build standalone executables and C/C++ shared libraries from MATLAB code.


Get free kit

Trials Available

Try the latest version of MATLAB Compiler.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS