Effacer les filtres
Effacer les filtres

Is it possible to autmaticly switch between referenced model and subsystem in Simulink?

5 vues (au cours des 30 derniers jours)
Suppose there is a referenced model in a top model in Simulink. Is it possible to change this model to a subsystem from command line? I can do it by "copy-paste" the content, however I need it to be done in an automatic way.

Réponse acceptée

Ayush
Ayush le 5 Oct 2023
  1 commentaire
Bartlomiej Stanczyk
Bartlomiej Stanczyk le 5 Oct 2023
Sorry for duplicating questions. In the meanime I have managed to extend the code provided in the answer you mentioned to work with models that involve more than one referenced model at the same level.
The whole difference in the code is to substitute the line
ref_block_path = getfullname(mdlRefsHandles);
with
ref_block_path = getfullname(mdlRefsHandles(k));

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Create Large-Scale Model Components dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by