主要内容

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:

GoalAppropriate Product
Produce readable and compact C and C++ code from MATLAB code for deployment to desktop and embedded systemsMATLAB Coder
Generate MEX functions from MATLAB code for code verification and accelerationMATLAB Coder
Use software-in-the-loop (SIL) and processor-in-the-loop (PIL) simulation to verify the numerical accuracy of the generated codeEmbedded Coder®
Generate C and C++ code optimized for embedded processorsEmbedded Coder
Accelerate fixed-point MATLAB codeFixed-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 codeHDL Coder™
Generate High-Level Synthesis (HLS) libraries from MATLAB codeHDL Coder
Interface C code with MATLAB

MATLAB mex function

Generate C and C++ code from Simulink models or Stateflow® chartsSimulink Coder

See Also

Apps

Functions

Topics