MATLAB & Simulink


Embedded Coder for Production Code Generation

Course Highlights

This hands-on, two-day course focuses on developing models in the Simulink® environment to deploy on embedded systems. The course is designed for Simulink users who intend to generate, validate, and customize embedded code using Embedded Coder®.

  • Generated code structure and execution

  • Code generation options and optimizations

  • Integrating generated code with external code

  • Generating code for multirate systems

  • Customizing generated code

  • Customizing data

Who Should Attend

Engineers who need to generate optimized code from their Simulink model to be deployed to embedded targets. 

Course Prerequisite

MATLAB Fundamentals, Simulink for System and Algorithm Modeling 

Course Benefits

Upon the completion of the course, the participants will be able to

- identify generated code modules, entry-point functions and data structures

- optimize the generated code and control the partioning of the generated code. 



Upcoming Program

xilinx ATP 黑.png

Techsource Systems is
Mathworks Sole and Authorised Distributor and Training Partner

Course Outline

Day 1 of 2

Generating Embedded Code


Objective: Configure Simulink models for embedded code generation and effectively interpret the generated code.

  • Architecture of an embedded application

  • System specification - Generating code

  • Code modules - Logging intermediate signals

  • Data structures in generated code

  • Validating generated code

  • Embedded Coder build process 

Optimizing Generated Code


Objective: Identify the requirements of the application at hand and configure optimization settings to satisfy these requirements.

  • Optimization considerations

  • Removing unnecessary code

  • Removing unnecessary data support

  • Optimizing data storage

  • Profiling generated code

  • Code generation objectives


Integrating Generated Code with External Code


Objective: Modify models and files to run generated code and external code together.

  • External code integration overview 

  • Model entry points

  • Creating an execution harness 

  • Controlling code destination

  • Packaging generated code 


Controlling Function Prototypes


Objective: Customize function prototypes of model entry points in the generated code.

  • Default model function prototype

  • Modifying function prototypes

  • Generated code with modified function prototypes

  • Calling generated code with customized entry points

  • Model function prototype considerations

Customizing Data Characteristics in Simulink


Objective: Control the data types and storage classes of data in Simulink.

  • Data characteristics

  • Data type classification

  • Simulink data type configuration

  • Setting signal storage classes

  • Setting state storage classes

  • Impact of storage classes on symbols

Day 2 of 2

Customizing Data Characteristics Using Data Objects


Objective: Control the data types and storage classes of data using data objects.

  • Simulink data objects overview

  • Controlling data types with data objects

  • Creating reconfigurable data types

  • Controlling storage classes with data objects

  • Controlling data type and variable names

  • Data dictionaries

Customizing Generated Code Architecture  

Objective: Control the architecture of the generated code according to application requirements.

  • Simulink model architecture

  • Controlling Simulink code partitioning

  • Generating reusable subsystem code

  • Generating variant component

  • Data placement options 



Model Referencing and Bus Object 


Objective: Control the data type and storage class of bus objects and use them for generating code from models that reference other models.

  • Creating reusable model references 

  • Controlling the data type of bus signals

  • Controlling the storage class of bus signals

  • Model reference software testing 

Scheduling Generated Code Execution  

Objective: Generate code for multirate systems in single-tasking, multitasking, and function call-driven configurations.

  • Execution schemes for single-rate and multirate systems

  • Generated code for single-rate models

  • Multirate single-tasking code - Multirate multitasking code

  • Generating exported functions  


Improving Code Efficiency and Compliance  


Objective: Inspect the efficiency of generated code and verify compliance with standards and guidelines.


  • Model Advisor

  • Hardware implementation parameters