このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
バリアント パラメーター
Simulink® のバリアント パラメーターを使用すると、システムの値のバリエーションを単一のモデルで表現できます。シミュレートするバリアントに基づいて、さまざまな値のセットをグループ化できます。バリアント制御に応じて、各値セットをアクティブにできます。バリアント パラメーターを任意の Simulink ブロックに組み込むことができます。詳細については、バリアントとは、およびどのような場合にそれを使用するかを参照してください。
Simulink のバリアント マネージャーを使用して、モデル内のバリアント パラメーターを管理できます。
バリアント パラメーターに対して生成するコードには、システムがとり得るすべての値を含めることができます。Activate Variant During Different Stages of Simulation and Code Generation Workflowで説明されているように、コードのコンパイル前またはモデルの起動時に値を切り替えることができます。
トピック
- Options to Represent Variant Parameters in Generated Code
You can generate the code only for active values or for both active and inactive values of variant parameters in Simulink.
- Improve Code Readability of Variant Parameters Using Enumerated Types
You can use enumerated types to improve code readability of variant control values in variant parameters.
- Compile Code Conditionally for All Values of Variant Parameters with Same and Different Dimensions
This example shows how to generate a C code that contains all the active and inactive values of variant parameters.
- Run Executable for Different Variant Parameter Values Without Recompiling Code
This example shows how to generate an executable that runs for different set of variant parameter values without needing to recompile the code for each set of values.
- Reuse Variant Parameter Values from Handwritten Code Using Simulink.Parameter Variables
This example shows how to use
variables to generate a code that imports variant parameter values from your existing code.Simulink.Parameter - Generate Code for Instance-Specific Variation of Variant Parameter Values in Model Reference Hierarchy
Configure instance-specific values for variant parameters in a referenced model.
- Configure Code Generation for Variant Parameters in Model Workspace Using Code Mappings Editor
Learn how to use the Code Mappings editor to configure the code generation attributes for Simulink.VariantVariable and Simulink.VariantControl objects defined in the model workspace of a model.