MATLAB Examples

Generate a Main Program for Deployment to a Bare Board Target (No Operating System)

This model shows the Generate an example main program feature of Embedded Coder®. The model is configured to generate a main program suitable for deployment on a bare-board target (one with no operating system). Alternatively, you can configure the model to generate an example main program for deployment on a VxWorks® operating system target. The example ert_main.c that is generated for the model shows how to deploy the code.

You can customize a generated main program by using the Embedded Coder File customization template which is located on the Code Generation > Templates pane. See the Embedded Coder documentation for a description of this feature.


Open Example Model

Open the example model rtwdemo_examplemain.



To select the Generate an example main program option,

  1. From the menu bar, choose Simulation > Model Configuration Parameters.
  2. Select the Code Generation > Templates pane.
  3. Select Generate an example main program.
  4. Configure Target operating system.