How to suppress warnings when running Simulink simulation programmatically?

50 views (last 30 days)
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.

Accepted Answer

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

More Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Tags

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!