Variant 계층적 구성요소
계층적 Variant 블록을 사용하면 시스템의 모든 설계 대안을 단일 모델로 표현할 수 있습니다. 각 설계의 선택은 개별 계층 구조의 Variant 선택지로 모델에 포함됩니다. 이러한 모델은 고정된 공통 구조와 한정된 세트의 가변 구성요소를 가지며, 가변 구성요소는 Variant 제어에 따라 활성화되거나 비활성화됩니다.
예를 들어, 엔진 구성이 다음과 같이 세 가지로 가능한 차량 모델을 시뮬레이션한다고 가정하겠습니다: 4-실린더 가스, 6-실린더 가스, 8-실린더 가스. Variant Subsystem, Variant Model, Variant Assembly Subsystem 블록 내에 각 엔진 모델을 별도의 서브시스템으로 구현한 다음 사용자가 선택한 Variant 제어에 따라 서브시스템 간에 전환할 수 있습니다. 자세한 내용은 Introduction to Variant Controls 항목을 참조하십시오.
계층적 Variant 블록에 대해 생성한 코드에는 시스템의 모든 Variant 선택지가 포함될 수 있습니다. Activate Variant During Different Stages of Simulation and Code Generation Workflow 항목에 설명한 대로 코드를 컴파일하기 전에 또는 모델을 시작할 때 선택지 간에 전환할 수 있습니다. 계층적 Variant 블록으로 코드를 생성하는 방법에 관한 자세한 내용은 항목을 참조하십시오.
블록
Variant Subsystem, Variant Model, Variant Assembly Subsystem | Template subsystem containing Subsystem, Model, or Subsystem Reference blocks as variant choices |
클래스
Simulink.VariantControl | Create a variant control variable object (R2021a 이후) |
Simulink.Parameter | Store, share, and configure parameter values |
Simulink.Variant | Specify conditions that control variant selection |
Simulink.VariantUtils | Utility methods to work with variant elements (R2023b 이후) |
함수
enumeration | 클래스의 열거형 멤버와 이름 |
객체
struct | 구조체형 배열 |
도움말 항목
- Variant Subsystem을 사용하여 개별 계층 구조에 변형 구현
Variant Subsystem의 기본 기능을 알아봅니다.
- Variant Control Modes in Variant Blocks
Learn how to control variant blocks.
- Propagate Variant Conditions to Define Variant Regions with Variant Blocks
Determine active model components by propagating variant conditions using variant blocks.
- Propagate Variant Conditions to Define Variant Regions Outside Variant Subsystems
Propagate variant conditions outside a Variant Subsystem block to adapt its interface according to the state of underlying blocks.
- Model Reference Variants
This example shows how to use model reference variants.
- 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.
- Add or Remove Variant Choices of Variant Assembly Subsystem Blocks Using External Files
Understand how to add or remove variant choices of the Variant Assembly Subsystem block using external files without modifying model.
- Control Variant Choices in Masked Variant Assembly Subsystem Block Using Mask Parameter Object
Specify variant choices and set an active choice in a masked Variant Assembly Subsystem block.
문제 해결
Convert Configurable Subsystem to Variant Subsystem
Learn how to convert configurable subsystems to variant subsystems and their behavior on loading.
Convert Variant Subsystem to Variant Assembly Subsystem
Steps to convert Variant Subsystem block to Variant Assembly Subsystem block.
Transform Model to Variant System (Simulink Check)
Use the Model Transformer tool to transform a model into a variant system.