Code Generation for model Referencing

7 visualizzazioni (ultimi 30 giorni)
Abhijeet Kate
Abhijeet Kate il 16 Gen 2025
Commentato: Abhijeet Kate il 30 Gen 2025
Hello,
I build a model using model referencing.Then i generated the code using Embedded Coder.
As there were two models -parent and child model.So two different files c files are created in two different file structures(as there are two different model)
Is there anyway i can generate code for both model (parent and chid) in same folder?

Risposte (1)

Divyanshu
Divyanshu il 17 Gen 2025
By default if you are using 'Model' block to refer to child model then during code-generation two separate files are created for 'parent' and 'child' because they are two different models, and parent model just refers the child model.
However, a possible workaround is to make child model a part of parent model using 'Subsystem' block.
  • You can try using 'Subsystem' block instead of 'Model reference'.
  • Copy the entire child model and paste it inside the 'Subsytem' block.
  • Generate the code for the new model.
You can refer the following documentation for more details about 'Subsystem' block.
Hope it helps!
  2 Commenti
Abhijeet Kate
Abhijeet Kate il 18 Gen 2025
No sorry,
It is required that i must use a model referencing for my project.Please help me where my code is generated in same files while i am using model reference.

Accedi per commentare.

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by