How can I place the generated code in different customised folders during code generation for two referenced models during the code generation for the entire model ?

9 views (last 30 days)
I have created a model consisting of two referenced model through the model block. However during the code generation for the entire model, the code for the referenced models are placed in the slprj folder. I want to place the code for the referenced models in two different folders at two different locations. How can this be done ?

Answers (1)

Divyanshu
Divyanshu on 17 Jan 2025
I am not sure if it is possible to place generated code for referenced models at different locations, probably you can try using 'Shared code placement' parameter, you can specify the location where you want to place the generated code for a model. The path to the parameter is:
'Configuration Parameters > Code Generation > Interface > Shared code placement'.
You can execute the following command to get more details on this parameter:
>>web(fullfile(docroot,"rtw/ref/sharedcodeplacement.html"))
However, if this doesn't work for referenced models, then you might have to use 'subsystem' blocks instead of 'Model references' to keep the generated code for the entire model at a specified custom location. Please executed the following command to open documentation on 'subsystem' blocks:
>>web(fullfile(docroot,"simulink/slref/subsystem.html"))

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!