Is there a way to directly build only the ‘Protected Model Reference’?

1 vue (au cours des 30 derniers jours)
Is there a way to directly build only the ‘Protected Model Reference’? I have found that I have to put a subsystem [click the protected model reference, Ctrl+G] around the system before it allows the Code > C/C++ Code > Build Selected Subsystem option. Is there a way around this?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 14 Juin 2019
No there is no direct way to build the code for model reference block. If you want to generate code for only the model reference block then you will have to put it into a subsystem. You can always put the model reference inside a model and build the entire model.
Now, when you want to generate code for only the model reference block, there is no clear understanding as to how the code will interface with other blocks or inputs & outputs. When you put the model reference inside the subsystem, you create a boundary interface to interact with the internal logic of the model reference. Its a very subtle point, about the interface to communicate with the block logic upon code generation.
The short answer to the question is, yes, you have to add the model reference inside a subsystem to generate code for it unless you are building code for the entire top level model. When you are building code for the entire top level model then, in a way, you have already taken care of the interfacing component.

Plus de réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by