Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop Embedded Coder   

About Modeling Patterns

Several standard methods are available for setting up a model to generate specific C Constructs in your code. For preparing your model for code generation, some of these methods include: configuring signals and ports, initializing states, and setting up configuration parameters for code generation. Depending on the components of your model, some of these methods are optional. Methods for configuring a model to generate specific C constructs are organized by category, for example, the Control Flow category includes constructs if-else, switch, for, and while. Refer to the name of a construct to see how you should configure blocks and parameters in your model. Different modeling methodologies are available, such as Simulink blocks, Stateflow® charts, and Embedded MATLAB™ blocks, to implement a C construct.

Model examples have the following naming conventions:

Model ComponentsNaming Convention
Inputsu1, u2, u3, and so on
Outputsy1, y2, y3, and so on
Parametersp1, p2, p3, and so on
Statesx1, x2, x3, and so on

Input ports are named to reflect the signal names that they propagate.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS