replace entire mdl file from app designer

1 回表示 (過去 30 日間)
Bhisma Adhikari
Bhisma Adhikari 2020 年 1 月 27 日
コメント済み: Bhisma Adhikari 2020 年 1 月 31 日
My Simulink project (saved as mymodel.mdl) is opened in the Simulink window. I need to replace mymodel.mdl's entire content with the content from some other mdl file when I click a button in an app designed in app-designer (saved as myapp.mlapp). How do I do this?

採用された回答

Ganesh Regoti
Ganesh Regoti 2020 年 1 月 31 日
Hi,
You can copy the contents from one Simulink model to another through appdesigner using subsystem commands. Here is the link you can refer to
Here is the small example to copy contents from one model to a subsystem of other model.
open_system('vdp');
new_system('new_model_with_vdp')
open_system('new_model_with_vdp');
add_block('built-in/Subsystem', 'new_model_with_vdp/vdp_subsystem')
Simulink.BlockDiagram.copyContentsToSubsystem...
('vdp', 'new_model_with_vdp/vdp_subsystem')
Hope this helps!
  1 件のコメント
Bhisma Adhikari
Bhisma Adhikari 2020 年 1 月 31 日
That was very helpful. Thank you, Ganesh!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by