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

4 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Ayush
Ayush el 5 de Oct. de 2023
  1 comentario
Bartlomiej Stanczyk
Bartlomiej Stanczyk el 5 de Oct. de 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));

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by