Code Generation Fundamentals
R2026bMain steps of code generation workflow
Learn the fundamental steps for converting MATLAB® code to C and C++ code. These steps include preparing your MATLAB code for code generation, specifying input types, specifying code generation configuration settings, generating code, and exploring the generated code.
To generate C/C++ source code, static libraries, dynamic libraries, or executables from MATLAB code, follow the Overview of Code Generation Using MATLAB Coder. To move through the fundamental steps of the code generation workflow, click on the boxes in the image below.
Code Generation Overview
Categories
- Prepare MATLAB Code
Identify and fix issues in MATLAB code prior to code generation
- Specify Input Types
Specify properties of MATLAB function input variables to enable code generation
- Check for Run-Time Issues
Check for run-time issues by generating trial MEX function before generating production code
- Configure Code Generation
Parameters that control various aspects of the generated code, including speed, memory use, and code appearance
- Generate Code
Generate code and build standalone libraries and executables
- Explore Generated Code
Use code generation reports to explore and understand the generated code