How to suppress warnings when running Simulink simulation programmatically?

58 次查看(过去 30 天)
I am running a Simulink simulation from my_sim.m MATLAB file:
...
sim('rocket_sim');
fprintf('Finished. \n');
...
I am getting huge number of warnings which flood the console output.
How can I suppress the warnings? All I want to see is the "Finished." message.

采纳的回答

Rik
Rik 2020-5-22
Unless Simulink is not playing nice, this should work:
...
w=warning('off','all');
sim('rocket_sim');
warning(w);
fprintf('Finished. \n');
...

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by