Main Content

Model References

Reuse models as blocks in other models

Amodel referenceis a reference to another model using aModelblock. These references create model hierarchy. Each referenced model has a defined interface that specifies the properties of its inputs and outputs. The defined interface makes the behavior of the referenced model independent of its context in the model hierarchy. For simulation and code generation, a referenced model executes like a single block, or atomic unit, when the parent model executes. Model references are ideal for code reuse, unit testing, parallel builds, and large components. They can also reduce file contention and merge issues.

To determine whether referenced models meet your modeling requirements, seeComponent-Based Modeling Guidelines.

To learn about code generation for model reference hierarchies, seeReferenced Models(Simulink Coder).

To create a protected model, seeModel Protection(Simulink Coder).

Blocks

Model Reference another model to create model hierarchy
Variant Model Template subsystem containing Subsystem, Model, or Subsystem Reference blocks as variant choices

Functions

expand all

depview Analyze and visualize model referencing dependencies with or without library dependencies
find_mdlrefs Find referenced models and Model blocks in model hierarchy
Simulink.BlockPath Fully specified Simulink block path
Simulink.fileGenControl Specify root folders for files generated by diagram updates and model builds
Simulink.ModelReference.refresh Update Model blocks to reflect changes to referenced models
Simulink.SubSystem.convertToModelReference Convert subsystem to model reference
slbuild Build standalone executable file or model reference target for model
基金cinfo Query contents of Simulink cache files
基金cunpack Unpack simulation and code generation targets from Simulink cache file
Simulink.ProtectedModel.createHarness Create harness model that provides isolated environment for testing protected model
金宝appSimulink.ProtectedModel.getPublisher Return information about publisher that signed the protected model
Simulink.ProtectedModel.verifySignature Verify digital signature on protected model
Simulink.ProtectedModel.suppressSignatureVerification Suppress digital signature verification of protected models

Tools

模型参考转换顾问 Convert subsystems to referenced models
Referenced Files Pane View, save, and close referenced subsystems and models

Topics

Determine When to Reference Models

Create Model References

Configure Model References

模拟模式l Hierarchies