Main Content

このページは前リリースの情報です。該当の英語のページはこのリリースで削除されています。

バリアント システム

バリアント ブロック、シンボリック次元、パラメーターのバリアントのコード生成

バリアント ブロックやバリアント パラメーターを含むモデルまたはシンボリック次元を使用するモデルでは、プリプロセッサの条件をもつコードを生成します。バリアント ブロックおよびバリアント パラメーターの場合、プリプロセッサの条件はコンパイル時までアクティブなバリアントの選択を遅らせるか、アクティブなバリアントの選択を許可しません。シンボリック次元の場合、プリプロセッサの条件はシミュレーション中にシンボル全体に対して確立される制約を定義します。

トピック

バリアント ブロック

バリアント パラメーター

  • 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®. You can also represent the values of variant parameters as inline variables or as tunable variables in the generated code.
  • 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. Simulink 列挙型 improve readability because enumerated types of variant controls values are represented as meaningful names instead of integers in the generated code.
  • Reuse Variant Parameter Values from Handwritten Code Using Simulink.Parameter Variables
    This example shows how to use Simulink.Parameter variables to generate a code that imports variant parameter values from your existing code. Importing variant parameter values allows you to reuse the values that your existing code defines. You can then integrate and compile the generated and existing code into a single executable. You can choose to generate a code that imports variant parameter values at the beginning of code compile, simulation-loop, or model startup phases of simulation and code generation workflows based on the activation time you specify. For more information, see Activate Variant During Different Stages of Simulation and Code Generation Workflow.
  • 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.

シンボリック次元