Inserting #ifdef in generated code

11 vues (au cours des 30 derniers jours)
Mayuresh Karandikar
Mayuresh Karandikar le 5 Sep 2017
Modifié(e) : Nick Sarnie le 8 Sep 2017
I am trying to create a common model whose code will be deployed in two different application variants. Part/ some of the subsystems are only applicable to one variant and not other. So, in the EC generated code, I would like to see statements like #if APP1 or #ifdef APP1. How can I achieve this ?

Réponses (1)

Nick Sarnie
Nick Sarnie le 8 Sep 2017
Modifié(e) : Nick Sarnie le 8 Sep 2017
Hi Mayuresh,
The easiest way to automatically generate preprocessor conditionals is to use a variant subsystem, which is activated based upon which application variant is set. Please take a look at the following documentation page for more information and examples about how to generate these conditionals:
If you are looking to have more fine detailed control below the subsystem level, please provide some more information about what you wish to control with preprocessor conditionals.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by