Variant Code Generation
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™.
- Prepare Variant-Containing Model for Code Generation
Configure and generate code for a variant model.
- Generate Code for Export-Function Model
Generate code for functions that can be integrated with an external scheduler.