Main Content

Compare Capabilities of Model Components

Before you implement a piece of your system using a specific type of model component, consider whether the component type satisfies your modeling requirements.

Tip

To identify which component types to consider based on high-level guidelines and use cases, seeChoose Among Types of Model Components.

Component Consideration Modeling Requirements
Development Process
  • Separate files

  • Component reuse

  • Shared data

  • Instance-specific edits

  • Variants

  • Version control and configuration management

  • Intellectual property protection

  • Unit testing

Performance Requirements
  • Incremental model loading

  • Build artifact reuse

  • Reduced memory usage for large models

  • Artificial algebraic loop elimination

Features
  • Compatible configuration parameter settings

  • Signal property specification at interfaces

  • Physical connections at interfaces

  • Bus specification

  • State initialization

  • Conditional execution

  • Event-based behavior

  • Independent functions

Note

For code generation considerations, see:

Development Process

Modeling Requirement Subsystems Linked Subsystems Subsystem References Model References
Separate Files

Not supported

You save a subsystem in the same file as its parent.

To create or change a subsystem, you must edit the parent file, which can lead to file contention and merge problems.

Supported

You save the parent library block of a linked block in a separate file.

Using separate files helps to avoid file contention.

Supported

You save a referenced subsystem in a separate file.

Using separate files helps to avoid file contention.

Supported

You save a referenced model in a separate file.

Using separate files helps to avoid file contention.

Component Reuse

Not supported

While you can copy a subsystem to reuse it in a model, the copies are independent of each other.

Supported

You can link to the same parent library block multiple times in multiple models without creating copies.

Managing library links adds some overhead, such as managing broken, disabled, or parameterized links.

Supported

You can reference the same subsystem multiple times in multiple models without creating copies.

Supported

You can reference the same model multiple times in multiple models without creating copies. SeeModel Reuse.

Shared Data

Supported

您可以通过定义实例之间共享数据data outside the component. For example, by using a data store in a common parent subsystem.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

You can share data among instances of the referenced model by creating a data store inside the model. SeeShare Data Among Referenced Model Instances.

Instance-Specific Edits

Supported

Subsystem copies are independent of each other.

Supported

When you edit a parent library block, the changes apply to the library file and propagate to all blocks that link to that block.

To edit an instance of the block, you can disable the library link.

You cannot disable library links when the parent library block has restricted write access.

Not supported

When you edit an instance of a referenced subsystem, the changes apply to the subsystem file and propagate to all other instances of the referenced subsystem.

Not supported

When you edit an instance of a referenced model, the changes apply to the model file and propagate to all other instances of the referenced model.

You can specify instance-specific parameter values for referenced models. For more information, seeParameterize Instances of a Reusable Referenced Model.

Variants

Supported

Add subsystem variants to aVariant SubsystemorVariant Modelblock.

For more information, seeDefine, Configure, and Activate Variant Choices in a Variant Subsystem Block.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

Add model variants to aVariant SubsystemorVariant Modelblock.

For more information, seeDefine, Configure, and Activate Variant Choices in a Variant Subsystem Block.

Version Control and Configuration Management

Not supported

You cannot directly place subsystems in a source control system.

To reduce file contention and use separate version control for each subsystem, use a subsystem reference.

Supported

You can place library files in a source control system.

To provide individual version control for each library block, use subsystem references and model references in the library. When you drag these blocks from the library into your model, they reference the subsystem file or model file.

Forwarding tables allow you to map old library blocks to new versions of the blocks.

Supported

You can place subsystem files in a source control system.

Supported

You can place model files in a source control system.

Intellectual Property Protection

Not supported

Use model references instead.

Not supported

Same behavior as subsystems.

Not supported

Same behavior as subsystems.

Supported

Protected models obscure model contents, which can be useful when distributing models.

Creating a protected model requires a万博1manbetx®Coder™license. For more information, seeProtect Models to Conceal Contents(Simulink Coder).

Using a protected model doesnotrequire aSimulink Coderlicense. For more information, seeReference Protected Models from Third Parties.

Unit Testing

Supported

国防部子系统依赖于上下文el. If the context of a subsystem changes, such as the data type of an input signal, the related test harness must be updated.

For subsystems that are not atomic, the test harness may use different block execution orders, due to virtual boundaries.

For tools that support authoring, managing, and executing systematic, simulation-based tests of subsystems, seeCreate Test Harnesses and Select Properties(Simulink Test).

To measure how thoroughly model components are tested, seeModel Coverage(Simulink Coverage).

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

You can test a referenced model independently to isolate behavior by simulating it as a top model.

You can use a data-defined test harness, with MATLAB®test vectors and direct coverage collection.

For tools that support authoring, managing, and executing systematic, simulation-based tests of subsystems, seeCreate Test Harnesses and Select Properties(Simulink Test).

To measure how thoroughly model components are tested, seeModel Coverage(Simulink Coverage).

Performance Requirements

Modeling Requirement Subsystems Linked Subsystems Subsystem References Model References
Incremental Model Loading

Not supported

Loading a model loads all subsystem contents that are saved in the model.

Supported

Simulink incrementally loads a library at the point needed during editing, updating a diagram, or simulating a model.

Supported

Simulink incrementally loads a referenced subsystem at the point needed during editing, updating a diagram, or simulating a model.

Supported

Simulink incrementally loads a referenced model at the point needed during editing, updating a diagram, or simulating a model.

Build Artifact Reuse

Not supported

Build artifacts, such as simulation targets, are not generated for subsystems.

Not supported

Same behavior as subsystems.

Not supported

Same behavior as subsystems.

Supported

You can share and reuse build artifacts, such as simulation targets, using Simulink cache files. For more information, seeShare Simulink Cache Files for Faster Simulation.

Reduced Memory Usage for Large Models

Not supported

Subsystems do not reduce memory usage for simulation and code generation.

Not supported

Linked subsystems do not reduce memory usage for simulation and code generation.

Simulink duplicates library block instances during block update.

Not supported

Subsystem references do not reduce memory usage for simulation and code generation.

Simulink duplicates subsystem reference instances during block update.

Supported

Models referenced in accelerator mode reduce memory usage for simulation and code generation because Simulink incrementally loads compiled versions of them.

Artificial Algebraic Loop Elimination

Supported

Subsystems that are not atomic avoid artificial algebraic loops.

If a subsystem is atomic, you can try to eliminate artificial algebraic loops by enabling theSubsystemblock parameterMinimize algebraic loop occurrences.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

You can try to eliminate artificial algebraic loops by enablingConfiguration Parameters>Model Referencing>Minimize algebraic loop occurrences.

Features

Modeling Requirement Subsystems Linked Subsystems Subsystem References Model References
Compatible Configuration Parameter Settings

Supported

Subsystems use the configuration parameter settings of the model that contains them.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

通常可以配置参数设置different for a parent model and its referenced models. For compatibility information, seeSet Configuration Parameters for Model Hierarchies.

Signal Property Specification at Interfaces

Supported

You can specify signal properties at a subsystem interface.

For signal properties that you do not specify, subsystems inherit the signal properties from their context. Propagation of signal properties can lead to Simulink using signal properties that you do not anticipate.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

You must specify most signal properties at a referenced model interface.

Referenced models are context-independent with a defined boundary, so they do not inherit most signal properties.

Referenced models can inherit discrete sample times when the referenced model is sample-time independent.

Physical Connections at Interfaces

Supported

You can specify physical connections at a subsystem interface.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Not supported

Physical connections must be fully contained within a referenced model. They cannot cross the model interface.

Bus Specification

Supported

You can use aSimulink.Busobject to specify the data type of a bus that passes into a subsystem.

Subsystems do not require the use ofBusobjects for virtual buses.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

You can use aSimulink.Busobject to specify the data type of a bus that passes into a referenced model.

Model references do not require the use ofBusobjects for virtual buses when you useIn Bus ElementandOut Bus Elementblocks.

State Initialization

Supported

You can initialize states of subsystems.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

You can initialize states from the top model using either the structure format or structure-with-time format.

Conditional Execution

Supported

Subsystems support conditional execution. For more information, seeConditionally Executed Subsystems Overview.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

Referenced models support conditional execution. For more information, seeConditionally Execute Referenced Models.

Event-Based Behavior

Supported

Subsystems support event-based behavior. For more information, seeUsing Initialize, Reinitialize, Reset, and Terminate Functions.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

Referenced models support event-based behavior. For more information, seeUsing Initialize, Reinitialize, Reset, and Terminate Functions.

Independent Functions

Supported

You can define independent functions in subsystems. For more information, seeSimulink Functions Overview.

Supported

Same behavior as subsystems.

Supported

Same behavior as subsystems.

Supported

You can define independent functions in a referenced model. For more information, seeExport-Function Models Overview.

Related Topics

External Websites