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 ?

답변 (1개)

Nick Sarnie
Nick Sarnie 2017년 9월 8일
편집: Nick Sarnie 2017년 9월 8일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

질문:

2017년 9월 5일

편집:

2017년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by