Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

变体系统

创建自定义模型版本以支持不同的规格,以避免重复操作

在 Simulink® 中,您可以创建基于模块化设计平台的模型,这种平台由一个固定的通用结构和一组有限数量的可变组件构成。这种可变性可以帮助您开发一个固定但具有可变组件的主设计。

这种方式有助于您满足受应用程序、成本或运营考虑因素制约的各种客户需求。

变体是模块化设计平台的可变组件。它们可以帮助您在一个统一的模块图中指定一个模型的多种实现。有关详细信息,请参阅什么是变体以及何时使用变体

有两种变体类型:分层变体和内联变体。分层变体通过 Variant Subsystem 模块实现,而内联变体通过 Variant SourceVariant Sink 模块实现。使用 Variant Subsystem 模块具有以下优点:

  • 允许您混合 Model Subsystem 模块作为变体系统

  • 支持灵活的 I/O,因此,各个变体不必全都具备相同数量的输入和输出端口

模块

Variant Subsystem, Variant Model包含 Subsystem 模块或 Model 模块作为变体选择项的模板子系统
Variant SourceRoute among multiple inputs using Variants
Variant SinkRoute amongst multiple outputs using Variants
Manual Variant SourceSwitch between multiple variant choices at input
Manual Variant Sink在输出端的多个变体选择项之间切换

Simulink.Variant指定控制变体选择的条件
Simulink.VariantConfigurationDataClass representing a variant configurations data object
Simulink.VariantManagerClass representing a set of Variant Manager functionality
Simulink.VariantConfigurationAnalysisClass representing a set of Variant Configuration Analysis functionality
Simulink.VariantControlCreate a variant control variable object
Simulink.VariantVariableCreate a variant parameter object

主题

变体简介

什么是变体以及何时使用变体

一个系统满足多种变体要求。

Variant Terminology

Learn terminology and parameters related to Simulink variants.

Create a Simple Variant Model

Learn how to create a model using Variant blocks.

变体控制项简介

了解如何控制变体模块。

Working with Variant Choices

Activate, inactivate, or create default variant choices.

Create Variant Controls Programmatically

Use MATLAB® code to define variant controls.

Approaches to Control Active Variant Choice of a Variant Block Using Mask or Model Workspace

This example shows different approaches to control the active choice of inline variant and Variant Subsystem blocks from a mask or a model workspace.

可变子系统

Variant Subsystems

Learn basic functionality of variant subsystems.

定义、配置和激活变体

表示可变子系统中的变体选择项。

Propagate Variant Conditions Outside a Variant Subsystem Block

Propagate variant conditions outside of Variant Subsystem block.

Use Variant Subsystem Blocks with Conditionally Executed Subsystems

Understand how to use Variant Subsystem blocks with conditionally executed systems as variant choices.

Convert Configurable Subsystem to Variant Subsystem

Learn how to convert configurable subsystems to variant subsystems and their behavior on loading.

Control Active Choice of Locked Custom Library Variant Subsystem Using Mask Parameter

Control active choice of Variant Subsystem that belongs to a locked custom library.

Automatic Mask Icon Promotion in Variant Subsystems

This example demonstrates how Simulink® automatically displays the mask icon of the active variant block on the parent Variant Subsystem block.

Variant Function-Call Signals on Variant Subsystem Outport

This example shows how the Variant Subsystem block allows function-call signals from its choice blocks to be merged on its outports.

内联变体

Define and Configure Variant Sources and Sinks

Represent variant choices using Inline Variants.

Visualize Variant Implementations in a Single Layer

View the variant choices in a model containing Inline Variants.

Variant Source and Variant Sink Blocks

Define variant choice in Variant Source and Sink blocks.

Variant Condition Propagation with Variant Sources and Sinks

Propagate variant conditions from the Variant Source and Variant Sink blocks.

Propagate Variant Conditions from Variant Source Blocks to Subsystem Blocks

Understand variant condition propagation to virtual and non-virtual subsystems.

Propagate Variant Conditions from Variant Source Blocks to Conditionally Executed Subsystems

Learn about variant condition propagation from Variant Source blocks to conditional subsystems .

Control Variant Condition Propagation

Control propagation of variant conditions upstream and downstream.

Variant Elements within Buses

Understand how to create variant bus, generate code, and variant condition propagation with bus.

Use Variant Source Block to Receive or Output Function-Call Signals for Simulation and Code Generation

This example shows how a Variant Source block receives function-call signals at its inports and conditionally merges the signals at its outport.

代码生成

Prepare Variant-Containing Model for Code Generation

Configure and generate code for a variant model.

变体管理器

Variant Manager Overview

Use a central tool to manage variation points of a variants model.

Create and Validate Variant Configurations

Create variant configuration for a model and validate their accuracy.

Import Control Variables to Variant Configuration

Import control variables associated with a model.

Define Constraints

Define constraints across models.

Reduce Models Containing Variant Blocks

Generate models with a subset of variant configurations.

Analyze Variant Configurations in Models Containing Variant Blocks

Analyze model references and libraries for each variant configuration in a model containing variant blocks.

变体参数

Use Variant Parameters to Reuse Block Parameters with Different Values

Design one model for many systems that differ in block parameter values.

Create a Simple Variant Parameter Model

This example shows you how to create simple model with variant parameters.

Variant Controls in Variant Parameters

Learn how to control variant parameters.

Change Active Values and Activation Time of Variant Parameters

This example shows how to change the active values and activation time of variant parameters in a Simulink® model.

示例模型

Variants Example Models

A set of concept examples that illustrate some of the Simulink variants capabilities.

特色示例