Changing model programmatically: discard changes and exit?

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

采纳的回答

Fangjun Jiang
Fangjun Jiang 2020-5-18
close_system(sys,saveflag)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by