MATLAB Examples

File Packaging for Models (Code and Data)

This example shows how referenced models provide system interface encapsulation and incremental code generation. You can reference one model from another model (one or more times), and all aspects of the referenced model are fixed: input/output signal types, parameter types, and sample times. Therefore, you can modularize your design and perform incremental code generation with Simulink Coder.

The data and functions of a referenced model are partitioned into its own set of files, independent of its parent model. In this example, the referenced model rtwdemo_mdlrefbot is referenced three times. For simulation and code generation, the model is incrementally generated, which means rtwdemo_mdlrefbot builds the first time, but not on subsequent builds (until you change rtwdemo_mdlrefbot).