Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

变体系统

为维度、子系统、变体模型以及包含 Variant Sink 和 Variant Source 模块的模型生成代码。

为包含变体模块或使用符号维度的模型生成具有预处理器条件句的代码。对于变体模块,预处理器条件句将选择活动变体的时间推迟到编译时,或者不允许选择活动变体。对于符号维度,预处理器条件句定义仿真期间在符号之间建立的约束。

主题

Represent Subsystem and Variant Models in Generated Code

Create a model with subsystem or variant models. Generate code that contains preprocessor conditionals that control the activation of each variant choice.

Implement Dimension Variants for Array Sizes in Generated Code

Specify dimension information as symbols in blocks and data objects. These symbols propagate throughout the model during simulation and then go into the generated code.

Compile Code Conditionally for all Values of Variant Parameters

This example shows how to generate a C code that contains all the active and inactive values of variant parameters.

Represent Variant Source and Sink Blocks in Generated Code

Generate code that contains preprocessor conditionals that control the activation of each variant choice and allow for no active variant choice.

Represent Variant Condition Values of Enumerated Type in Generated Code

Generate C code from Simulink® models having variant condition values of enumerated type.

Configure Dimension Variants for S-Function Blocks

Configure S-functions to support forward propagation, backward propagation, or forward and backward propagation of symbolic dimensions during simulation.

Code Generation for Variant Blocks

Generate code containing preprocessor conditionals that control the active variant choice for a Simulink model containing variant blocks.

Generate Preprocessor Conditionals for Variant Systems

Define variant control variables and configure model for generating preprocessor conditional directives.

Generate Code for Variant Subsystem with Child Subsystems of Different Output Signal Dimensions

This example shows how to use symbolic dimensions to generate code for a variant subsystem consisting of child subsystems of different output signal dimensions.

使用变体模型生成使用 C 预处理器条件句的代码

此示例说明如何使用模型变体生成使用预处理器条件句的代码,以控制哪些代码链接到嵌入式可执行文件中。