Main Content
Source Code Generation
Generate and verify source code modules for function deployment and
integration
Learn how to initiate source code generation and learn about the files and folders that the code generator produces. To organize large projects, use the code generation project template. Projects help you find required files, manage and share files and settings, interact with source control, generate controller code, and run test harness simulations.
You can start with Generate Code by Using the Quick Start Tool.
Apps
Embedded Coder | Generate readable, compact, and fast C and C++ code for embedded processors used in mass production |
Functions
Topics
Generate Code
- Generate Code by Using the Quick Start Tool
Prepare a model for quickly generating readable, efficient code. - Increase Code Generation Speed
Alter a model to increase the speed at which the code generator generates code. - Generate Code Using Embedded Coder
Select a target for a Simulink® model, configure options, generate C code for embedded systems, and view generated files. - Internationalization and Code Generation
Internationalization support for enabling efficient globalization. - What Is Code Replacement?
Why and how to replace code. Code replacement libraries that MathWorks provides. Contents of a code replacement library and how the code generator uses the contents. Terminology and limitations. - Replace Code Generated from Simulink Models
This example shows how to replace generated code by using a code replacement library. - Control Regeneration of Top Model Code
Choose options for regenerating code for the top-level model. - Set Up Model for Controlling Program Execution
Set up a model so that you can start and stop program execution for logging output, monitoring data, and tuning parameters. - Configure Model for Debugging
Configure a model so that generated code and the build process are set for debugging. - Reload Generated Code
Reload generated code from the Model Explorer.
Code Generation with Project
- 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.
Code Generation Files and Folders
- Manage Build Process Folders
Manage folders that the code generator creates. - Manage Build Process Files
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. - Build Process Support for File and Folder Names
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.