Variant 계층적 컴포넌트
R2026b계층적 Variant 블록을 사용하면 시스템의 모든 설계 대안을 하나의 모델로 나타낼 수 있습니다. 각 설계의 선택은 개별 계층 구조의 Variant 선택지로 모델에 포함됩니다. 이러한 모델은 고정된 공통 구조와 유한한 세트의 가변 컴포넌트를 가지며, 가변 컴포넌트는 Variant 제어에 따라 활성화되거나 비활성화됩니다.
예를 들어, 다음과 같은 세 가지 엔진 구성이 가능한 차량을 나타내는 모델을 시뮬레이션한다고 가정하겠습니다. 4-실린더 가스, 6-실린더 가스, 8-실린더 가스. Variant Subsystem 블록 내에 각 엔진 모델을 별도의 서브시스템으로 구현한 다음 사용자가 선택한 Variant 제어에 따라 서브시스템 간에 전환할 수 있습니다. 자세한 내용은 Introduction to Variant Controls 항목을 참조하십시오.
계층적 Variant 블록에 대해 생성한 코드에는 시스템의 모든 Variant 선택지가 포함될 수 있습니다. Activate Variant During Different Stages of Simulation and Code Generation Workflow 항목에 설명된 대로 코드를 컴파일하기 전이나 모델을 시작할 때 선택지 간에 전환할 수 있습니다. 계층적 Variant 블록으로 코드를 생성하는 방법에 관한 자세한 내용은 Variant 구조 (Simulink Coder) 항목을 참조하십시오.
블록
| Variant Subsystem | Template subsystem containing Subsystem blocks as variant choices |
클래스
Simulink.VariantUtils | Utility methods to work with variant elements (R2023b 이후) |
함수
enumeration | 클래스의 열거형 멤버와 이름 |
객체
struct | 구조체형 배열 |
Simulink.Parameter | 파라미터 값 저장, 공유, 구성 |
Simulink.VariantControl | Create variant control variable object |
Simulink.VariantExpression | Specify conditions that control variant selection |
도움말 항목
Variant 제어 구성하기
- Variant Control Modes in Variant Blocks
Learn how to control variant blocks. - Activate Variant During Different Stages of Simulation and Code Generation Workflow
Use variant activation time to set active choices during different stages of simulation and code generation workflows. - Working with Variant Choices
Activate, inactivate, or create default variant choices. - Use Variant Control Variables in Variant Blocks
This topic explains how to use different types of variant control variables in variant blocks. - 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.
Variant 조건 전파하기
- Propagate Variant Conditions to Define Variant Regions with Variant Blocks
Determine active model components by propagating variant conditions using variant blocks. - Assemble Variant Conditions Propagated from Variant Blocks
During simulation, Simulink® propagates the variant conditions specified on the variant blocks to the connecting blocks. - Propagate Variant Conditions to Define Variant Regions Outside Variant Subsystems to Promote Consistency and Reduce Errors
Propagate variant conditions outside a Variant Subsystem block to adapt its interface according to the state of underlying blocks. - Propagate Variant Conditions to Enable or Disable Model or Subsystem References in Hierarchy
Simulink® compiles referenced models before propagating variant conditions. - Variant Elements Within Buses
This example explains how to create buses with elements having different variant conditions. - Propagate Variant Conditions to Control Execution of Conditional Subsystems
Understand how to use Variant Subsystem blocks with conditionally executed systems as variant choices. - Control Variant Condition Propagation Using Bounded Regions and Signal-Level Isolation
Limit the scope of variant condition propagation by confining variant conditions to bounded regions or terminating them at specific signal paths.
작업 공간에서 Variant 제어 변수 정의하기
- Choose and Configure a Workspace for Variant Control Variables of Variant Blocks
Choose the workspace that matches your scoping, activation time, and hierarchy requirements for variant control variables in variant blocks. - Use Base Workspace to Define Globally Accessible Variant Control Variables for Variant Blocks
Control variant choices across models in a MATLAB session by defining variant control variables in the base workspace. - Use Data Dictionary to Define Shared Variant Control Variables for Variant Blocks
Control variant choices across multiple models by defining variant control variables in a data dictionary for version control, team sharing, and traceability. - Use Model Workspace to Define Variant Control Variables Scoped to the Model for Variant Blocks
Control variant choices by defining variant control variables in the model workspace to scope them to a single model so they persist with the model file. - Override Variant Control Variables of Variant Blocks in Simulation Runs
Override variant control variable values for individual simulation runs using a SimulationInput object without modifying persistent workspace or data dictionary values.
인스턴스별 Variant 제어 구성하기
- Use Model Arguments with Fast Restart to Switch Variant Choices Per Instance Without Recompiling for Variant Blocks
Control variant choices per model instance by defining variant control variables as model arguments in a referenced model. - Use Mask Parameters for Per-Instance Variant Control in Variant Blocks
Control variant choices per block instance by defining a mask parameter as the variant control variable and setting its value from the mask dialog box. - Use Mask Parameters with Fast Restart to Switch Variant Choices Without Recompiling for Variant Blocks
Control the active variant choice per block instance without recompiling by using mask parameters as variant control variables with the startup activation time and fast restart. - Use Mask Initialization Code for Per-Instance Variant Control in Variant Blocks
Control active variant choices in a variant block by defining variant control values or mapping mask parameter selections to label names in a mask initialization script. - Use Mask Parameters with Enumeration Classes for Per-Instance Variant Control of a Variant Block in a Locked Library
Control variant choices per block instance in a locked custom library by using mask parameters as variant control variables with enumeration classes in condition expressions. - Use Mask Parameter Object to Control Variant Choices in Masked Variant Assembly Subsystem Block
Control variant choices in a masked Variant Assembly Subsystem block by instantiating subclasses of a shared superclass as the mask parameter object value. - Control Active Choice of Variant Subsystem During Simulation or Execution of Generated Code
Switch the active variant of a Variant Subsystem block during simulation or execution of generated code by using a Parameter Writer block.
문제 해결
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.


