how to disable the CLI prompt to save simulink model before closing?

10 ビュー (過去 30 日間)
jessupj
jessupj 2020 年 8 月 31 日
回答済み: Uday Pradhan 2021 年 1 月 7 日
I'm calling simulink through non-GUI shell. Any error or interruption of the model (eg. Ctrl+c) seems to bring up an infinite and difficult-to-interrupt-over-remote-session prompt of the form:
----- Save "simulink_model" before closing? -----
1) Yes
2) No
3) Cancel
because i've made changes to the model configuration settings. I would like to just completely disable this behavior in the terminal wihtout disabling auto-save features in the GUI editor. I have statements like
try
% open/configure/run the model
catch
close_system(gcs,0)
end
to avoid this prompt from inside matlab, but those don't handle interruption of the matlab process from the shell.
This has probably been asked before, but I can't find it based on what i'm querying.

回答 (1 件)

Uday Pradhan
Uday Pradhan 2021 年 1 月 7 日
Hi,
If you want to save your changes, may be you could use "save_system" command in your try block. In this way, when you close the model, the prompt to save the model should no longer appear. You could also check out the "bdclose" command to close the model from command line, this doesn't trigger the Save model dialog but reverts unsaved changes.

カテゴリ

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