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

3 次查看(过去 30 天)
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.

采纳的回答

Ayush
Ayush 2023-10-5
  1 个评论
Bartlomiej Stanczyk
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));

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Subsystems 的更多信息

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by