For models that contain variant blocks or use symbolic dimensions, generate code with preprocessor conditionals. For variant blocks, preprocessor conditionals defer the choice of active variant until compilation time or they do not allow an active variant choice. For symbolic dimensions, preprocessor conditionals define constraints established among symbols during simulation.
Create a model with subsystem or variant models. Generate code that contains preprocessor conditionals that control the activation of each variant choice.
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.
This example shows how to generate a C code that contains all the active and inactive values of variant parameters.
Generate code that contains preprocessor conditionals that control the activation of each variant choice and allow for no active variant choice.
Generate C code from Simulink® models having variant condition values of enumerated type.
Configure S-functions to support forward propagation, backward propagation, or forward and backward propagation of symbolic dimensions during simulation.
Generate code containing preprocessor conditionals that control the active variant choice for a Simulink model containing variant blocks.
Define variant control variables and configure model for generating preprocessor conditional directives.
This example shows how to use symbolic dimensions to generate code for a variant subsystem consisting of child subsystems of different output signal dimensions.
This example shows you how to use model variants to generate code that uses preprocessor conditionals to control which code is linked into the embedded executable.