Changing model programmatically: discard changes and exit?

5 ビュー (過去 30 日間)
Danijel Domazet
Danijel Domazet 2020 年 5 月 18 日
回答済み: Fangjun Jiang 2020 年 5 月 18 日
Hi,
I programmatically change a model in Simulink, run the simulation, and exit.
open_system(...)
add_block(...)
sim(...)
When I run it again, I get an error from add_block() that the block already exists.
So I add
save_system('different_name')
and than I can run the model again with no problem.
However, I would like to exit without saving the modified model.
Is it possible to somehow discard the changes and exit?
  1 件のコメント
Stijn Haenen
Stijn Haenen 2020 年 5 月 18 日
You can stop/quit via the cmd prompt:
!TASKKILL /F /IM MATLABWindow.exe /T &

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

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 5 月 18 日
close_system(sys,saveflag)

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by