How to suppress warnings when running Simulink simulation programmatically?
54 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Danijel Domazet
le 22 Mai 2020
Commenté : Mehmet Burak Ekinci
le 31 Août 2023
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.
0 commentaires
Réponse acceptée
Rik
le 22 Mai 2020
Unless Simulink is not playing nice, this should work:
...
w=warning('off','all');
sim('rocket_sim');
warning(w);
fprintf('Finished. \n');
...
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!