How to suppress warnings when running Simulink simulation programmatically?

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');
...

2 件のコメント

Danijel Domazet
Danijel Domazet 2020 年 5 月 22 日
Indeed... Thanks.
Mehmet Burak Ekinci
Mehmet Burak Ekinci 2023 年 8 月 31 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Simulink についてさらに検索

製品

リリース

R2020a

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by