MATLAB Examples

Insert Pragmas for Functions and Data in Generated Code

This model shows how to insert pragmas for functions and data in generated code.


Explore Example Model

Open the example model.



  1. Learn about memory sections by clicking the documentation link in the model.
  2. View the memory sections in the ECoderDemos package by clicking the button in the model and then selecting the Memory Sections tab.
  3. View the memory sections selected for this model by clicking the button in the model. The model-level settings are also the default settings for atomic subsystems.
  4. Open the SubSystem Parameters dialog for the subsystems to see the memory section settings for each of the atomic subsystems in the model.
  5. Generate code by clicking the button in the model. An HTML report is displayed automatically. Inspect the data and function definitions in the .c files and observe how the generated pragmas correspond to the specified memory sections.