MATLAB Coder

MATLAB Coder

Generate C and C++ code from MATLAB code

MATLAB Coder™ generates C and C++ code from MATLAB® code for a variety of hardware platforms, from desktop systems to embedded hardware. It supports most of the MATLAB language and a wide range of toolboxes. You can integrate the generated code into your projects as source code, static libraries, or dynamic libraries. The generated code is readable and portable. You can incorporate your existing C code and libraries to get the ultimate efficiency for the key parts of your algorithm, or to reuse code you trust. You can also package the generated code as a MEX-function for use in the MATLAB environment for verification or acceleration.

Embedded Coder® enhances MATLAB Coder for production use with support for code customization, target-specific optimizations, code traceability, and software-in-the-loop (SIL) and processor-in-the-loop (PIL) verification.

To deploy complete applications, including the user interfaces, use MATLAB Compiler SDK™.

Run Anywhere

Deploy Algorithms Royalty-Free

Use any C compiler to compile and run your generated code on any hardware, from desktop systems to mobile devices to embedded hardware. The generated code is royalty-free—deploy it in commercial applications to your customers at no charge.

Supported Toolboxes and Functions

MATLAB Coder generates code from a broad range of MATLAB language features that design engineers use to develop algorithms as components of larger systems. This includes over 1900 operators and functions from MATLAB and companion toolboxes.

Prototype on Hardware

Get to hardware fast with automatic conversion of your algorithm to C.

Prototype on Desktop and Cloud Platforms

Use the MATLAB Coder app or equivalent command-line functions to quickly generate code for your signal processing, computer vision, deep learning, control systems, or other application and then compile the code for your hardware.

Integrate with Software

Reuse MATLAB algorithms as C code within your software environment.

Generate Code with Simple Interfaces That Are Easy to Integrate

Generated code uses C types in a natural way, simplifying integration with external code. You can integrate generated code as source code or libraries. Trusted C libraries or components can be brought into MATLAB for higher-fidelity testing and are automatically called from generated code as well.

Reuse MATLAB Tests on Generated Code Prior to Integration

Reuse existing MATLAB tests to verify the behavior of generated code in the interactive MATLAB environment. Use the MATLAB unit test framework to quickly develop a rich set of regression tests that can be used to verify the generated C code.

Verifying behavior of generated code before integrating with your application.

Accelerate Algorithms

Generate C code and compile it for use inside MATLAB.

Accelerate Algorithms on CPUs

You can call generated code as MEX functions from your MATLAB code to speed execution, though performance will vary depending on the nature of your MATLAB code. You can profile generated MEX functions to identify bottlenecks and focus your optimization efforts.