Generate code from referenced model without generating from the parent

조회 수: 10 (최근 30일)
Guilherme T Silva
Guilherme T Silva 2019년 4월 8일
댓글: Rodrigo Estrella 2020년 4월 17일
When working with large systems made of many referenced models I can either generate code from the top-level model (parent), which creates a separate .c file for each one of the children, or I can generate code only from one of the child models. The step function for the referenced model changes wether the code is generated from the parent or from the child model, so if I update the child I need to generate code from the parent, otherwise the child models will generate code in standalone mode. The problem is that this can be very time consuming, even if the top level model and most of the referenced ones are unchanged.
Is there a way to generate code only for a referenced model, while keeping the interfaces it had when it wasn't generated as a standalone model?
I'm sending a model attached (R2018a) to exemplify the problem I'm trying to solve. Notice how the code in ReferencedModel.c changes when you generate code directly from it or from its parent model (ParentModel.slx).

답변 (1개)

Nick Sarnie
Nick Sarnie 2019년 5월 13일
Hi Guilherme,
Does using "slbuild(modelName, 'ModelReferenceRTWTarget')" solve your issue?
Thanks,
Nick
  댓글 수: 1
Rodrigo Estrella
Rodrigo Estrella 2020년 4월 17일
Im having more less the same problem. I have a parent model with several childs. I want to generate the code for the parent model without generating the code for the childs models, because the code for the childs has already been generated. As i will be generating the code for a complete collection of parent models, it will be very inneficent to generate the code of the child models each time.

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

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by