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

主题

变体简介

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

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

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.

可变子系统

Variant Subsystems

Learn basic functionality of variant subsystems.

定义、配置和激活变体

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

Condition Propagation with Variant Subsystem

Propagate variant conditions outside of Variant Subsystem block.

Variant Systems with Conditional Systems

Understand variant condition propagation to conditionally executed systems.

Convert Configurable Subsystem to Variant Subsystem

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

内联变体

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 Inline Variants block.

Propagating Variant Conditions to Subsystems

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

Propagate Variant Condition to Conditional Subsystem

Learn about variant condition propagation with conditional subsystem.

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.

代码生成

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.

示例模型

Variants Example Models

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

特色示例