Decide Which Code Generation Product to Use
Use MATLAB® Coder™ to generate readable, compact C and C++ code from your MATLAB code. You can:
Generate standalone C and C++ code to use in your projects as source code, static libraries, or dynamic libraries.
Generate standalone C or C++ executables.
Generate MEX functions to accelerate computation-intensive operations in MATLAB.
You can deploy the generated code on desktop and embedded systems. By using MATLAB Coder to generate C and C++ code from your MATLAB code, you can perform software design, implementation, and testing completely within the MATLAB environment.
However, MATLAB Coder may not be the most appropriate product for your application. This table lists common project goals and the code generation products that support them:
| Goal | Appropriate Product |
|---|---|
| Produce readable and compact C and C++ code from MATLAB code for deployment to desktop and embedded systems | MATLAB Coder |
| Generate MEX functions from MATLAB code for code verification and acceleration | MATLAB Coder |
| Use software-in-the-loop (SIL) and processor-in-the-loop (PIL) simulation to verify the numerical accuracy of the generated code | Embedded Coder® |
| Generate C and C++ code optimized for embedded processors | Embedded Coder |
| Accelerate fixed-point MATLAB code | Fixed-Point Designer™ |
| Package MATLAB applications for deployment to users who do not have MATLAB | MATLAB Compiler™ MATLAB Compiler SDK™ |
| Deploy MATLAB-based GUI applications on a supported MATLAB host | MATLAB Compiler MATLAB Compiler SDK |
| Integrate MATLAB code into Simulink® | MATLAB Function (Simulink) block in Simulink |
| Generate hardware description language (HDL) code from MATLAB code | HDL Coder™ |
| Generate High-Level Synthesis (HLS) libraries from MATLAB code | HDL Coder |
| Interface C code with MATLAB | MATLAB
|
| Generate C and C++ code from Simulink models or Stateflow® charts | Simulink Coder |