The basic steps for producing code with the code generator are:
Open a model
Configure the model for code generation by selecting the target, the language, and the code generation objectives
Select the build approach (for example, toolchain approach)
Build the model
The model configuration parameters provide many options for the code generation and build process.
Embedded Coder | Generate readable, compact, and fast C and C++ code for embedded processors used in mass production |
Generate Code by Using the Quick Start Tool
Prepare a model for quickly generating readable, efficient code.
Check Model and Configuration for Code Generation
Assess model readiness to generate code by using the Model Advisor and Code Generation Advisor.
Generate Code Using Embedded Coder®
Select a target for a Simulink® model, configure options, generate C code for embedded systems, and view generated files.
This model shows the code generated for a Simulink model containing a MATLAB script.
Manage folders that the code generator creates.
Work with generated source files and dependency files that the code generator produces.
Manage Build Process File Dependencies
Work with generated source files and dependency files that the code generator produces.
Add Build Process Dependencies
Add dependency information for external code to the build process.
Build Process Support for Folder Names with Spaces or Special Characters
Troubleshoot build process errors that occur when file system issues prevent file processing.
Manage File Packaging of Generated Code Modules
Generate code modules and header files with the code generator.
Cross-Release Code Integration
Integrate generated code from previous releases with generated code from current release.
Integrate Generated Code by Using Cross-Release Workflow
Reuse previously generated code by using a cross-release SIL block in an integration model.
Use Protected Models from Previous Releases to Perform SIL Testing and Generate Code
Integrate generated code from protected models created in previous releases.
Integration of Code from Multiple Folders
Integrate separately generated code.
Internationalization and Code Generation
Internationalization support for enabling efficient globalization.
Generate Code and Simulate Models in a Project
This example shows how to use the code generation template for a new Project.
Generate Code and Simulate Models Programmatically with Project
This example shows how to use the Project API to create a new project and automate project tasks for manipulating files.
Tutorial for Generating C Code from a Control Algorithm for an Embedded System
This guided tutorial shows how to generate code for a control algorithm model, integrate the generated code with an existing system, and validate simulation and executable results.