Block warning messages in MATLAB

Sometimes, depending on the size of the image, when I call addframein MATLAB to add 2D images to the video, I get the following warning message.

Warning. The frame height was filled with a multiple of four, as required by the specified codec. In avifile.addframe at 127

My questions:

  • Are there any ways to disable special warnings like this? If so, is it possible to fix the warning in a variable of my code (i.e., Similar to the try and catch exception mechanism) instead of MATLAB printing this warning in the command window?

  • If the above is not possible. Is there a way to disable all warnings in MATLAB temporarily ?

+5
source share
1 answer

Using the command warning, you can disable all warnings or specific warnings by ID:

WARNING('OFF', 'MSGID')and WARNING('ON', 'MSGID')turn off and on the display of any warning marked with the message identifier MSGID. (Use the following LASTWARNto identify a warning identifier or use a function WARNING VERBOSE.) warningIs not case sensitive when matching message identifiers.

For more help on the command, warningtype help warningMATLAB at the command prompt.

+9

All Articles