Main Content

Variant Code Generation

Generate code for models containing variant blocks, variant parameters, variant transitions, and symbolic dimensions

You can include alternate designs of variant blocks, variant parameters, variant transitions, and symbolic dimensions in generated code. Variants in the generated code enable you to reuse and configure the code for different stages of development, such as testing different implementations or providing multifunctional code to third parties. You can activate or deactivate the variants depending on the variant control you select. For more information on variant controls, see Introduction to Variant Controls. You can also control the appearance, placement, definition, and declaration of variant controls in the generated code.

To generate code for the variable components in your model, install Embedded Coder® or Simulink® Coder™. For detailed information on code generation for variant blocks, see Variant Systems (Simulink Coder).

Topics

Featured Examples