Skip to Main Content Skip to Search
Product Documentation

Model Source - Specify custom source code

Library

Custom Code

Description

The Model Source block adds user-specified custom code to the model.c or model.cpp file that the code generator creates for the model that contains the block.

Parameters

Top of Model Source

Code to be added near the top of the generated model source file, in a user code (top of source file) section.

Bottom of Model Source

Code to be added at the bottom of the generated model source file, in a user code (bottom of source file) section.

Example

See Example: Using a Custom Code Block.

See Also

Model Header, System Derivatives, System Disable, System Enable, System Initialize, System Outputs, System Start, System Terminate, System Update
Custom Code Block Code Insertion in the Simulink Coder documentation

  


Related Products & Applications

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

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