Suppress Warning Messages
Afficher commentaires plus anciens
Is there a way to suppress the "Warning: Visualization blocks are not updated during command line simulation in rapid accelerator mode." messages?
The visualisation blocks are useful when running my model from Simulink so I don not want to delete them but I don't wand to receive the errors when running from the command line.
Thanks
Mike
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 3 Jan 2012
Here's a well-commented snippet of my code that you may find helpful. I used it to suppress an Excel informational message.
% Turn off note "Warning: Added specified worksheet."
% that appears in the command window.
% To set the warning state, you must first know the
% message identifier for the one warning you want to enable.
% To get that, query the last warning to acquire the identifier.
% For example:
% warnStruct = warning('query', 'last');
% msgid_integerCat = warnStruct.identifier
% Command window will show this:
% msgid_integerCat =
% MATLAB:xlswrite:AddSheet
% You need to pass the expression with the colons in it into the warning() function.
% Turn off note "Warning: Added specified worksheet." that appears in the command window.
warning('off', 'MATLAB:xlswrite:AddSheet');
3 commentaires
Alexei M
le 7 Avr 2017
Is this warning-off status temporary or permanent? If I type it into the command window just one time, will it forever after suppress that particular warning? Or is it reset after restarting Matlab? Or when does it get reset?
Image Analyst
le 7 Avr 2017
It's just for that session. If you want to suppress them permanently, you can call my attached TurnOffWarnings() function from your startup.m file. Modify it for additional warnings that you encounter that you'd with to suppress.
Alexei M
le 7 Avr 2017
Thanks!
Catégories
En savoir plus sur Error Handling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!