Code Generation for model Referencing

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?

답변 (1개)

Divyanshu
Divyanshu 2025년 1월 17일

0 개 추천

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

Abhijeet Kate
Abhijeet Kate 2025년 1월 18일
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.
Abhijeet Kate
Abhijeet Kate 2025년 1월 30일
Any updates?

댓글을 달려면 로그인하십시오.

카테고리

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

제품

릴리스

R2023b

질문:

2025년 1월 16일

댓글:

2025년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by