Using Preprocessor directives, how could I generate an autocode using embedded coder in simulink? What are the feasible otions to change the autocode from these preprocessor directives during runtime?

11 views (last 30 days)
Need to implement a simulink model in such a way that, the autocode generated would be containing all the switch logics that would be mentioned in the model.
Then , I need to select only that part of autocode to be executed, based on the selection of my preprocessor directives in the respective header files.
I tried to acheive solution for this requirement using variant subsystem; where i find both the switching logics in the autocode generated.
But, using thi smethod, the code that is to be used is not speciied at runtime.
The switching variable is not able to be changed once the model is build, which makes me to build the model everytime and generate autocode every time i build the model.
Rather, if I have any option to only use the particular part of code in autocode, without building the model everytime, then, i will be able to make changes runtime based on the switching parameter.

Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!