Main Content

Tutorial for Generating C Code from a Control Algorithm for an Embedded System

This guided tutorial uses a series of examples to show the workflow of generating code from a control algorithm for an embedded system. In each example, you learn how to perform a specific aspect of code generation or integration. The examples are based on a shared model. Each example has a unique version of that model and corresponding data set so that you can use the examples independently. You do not have to run the examples in a specific order. When you transition between examples, you save the current model so that each example captures your modifications to the model and model data.

To recover a model in its original state, delete your local copy of the model and model data. The model data is saved as PCG_Demo_#_data.mat.

Use these hyperlinks to navigate to the examples in the tutorial.

Third-Party Software

Some of the examples use the Eclipse™ IDE and the Cygwin™/gcc compiler. Instructions to install and use Eclipse™ and Cygwin™/gcc are available in Install and Use Cygwin and Eclipse.