本页面提供的是上一版软件的文档。当前版本中已删除对应的英文页面。
引用模型
您可以为模型引用层次结构生成代码,以实现:
增量代码生成 - 仅在模型自上次生成代码以来发生了更改的情况下才生成代码
增量加载 - 在使用时才加载引用模型,这样可以加快模型加载速度
模块化开发 - 独立开发和维护被引用模型,而不依赖于使用它的模型
代码重用 - 从引用模型中生成可重用代码
要从为引用模型生成代码的示例入门,请参阅Generate Code for Model Reference Hierarchy。
主题
- Generate Code for Model Reference Hierarchy
Introduces generating code for models referenced with Model blocks.
- Generated Functions in a Model Reference Hierarchy
About generated functions in a model reference hierarchy.
- Set Configuration Parameters for Code Generation of Model Hierarchies
Satisfy model reference hierarchy requirements to enable code generation.
- Convert Subsystem to Referenced Model and Generate Code
Use Model Reference Conversion Advisor to convert a Subsystem block to a Model block and generate code for the model reference hierarchy.
- Generate Reusable Code from Model Reference Hierarchy
Generate reusable subsystem code from a top model with Model blocks.
- Storage Classes for Parameters and Signals Used in Model Blocks
Configure storage classes for parameters and signals to transfer data in model reference hierarchy.
- Code Generation Limitations for Model Reference
Model references have limitations including, but not limited to, data logging, state initialization, and S-functions.
- Simulink Cache Files for Incremental Code Generation
Share Simulink cache files in team-based development to reduce build time and avoid unnecessary code regeneration.
- Specify Instance-Specific Parameter Values for Reusable Referenced Model
When you create a reusable component as a referenced model, configure block parameters to use the same value for instances of the component or a different value for each instance.
- Combine Code Generated for Multiple Models
Generate a single executable program from multiple models or multiple copies of the same model.