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

9 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by