Tuesday, April 17, 2012

Using warning messages, turning them on or off

Today I discovered a very cool feature of the command "warning" in matlab.

First, everywhere where you have a warning msg, you can use an Identifier for this warning. For example:

warning('Battery:SOC','this is not logical - Warning')

At the beging of the script or even outside the function, you can use

warning off Battery:SOC
As simple as that, you won't see the warnings anymore and you don't need to change your code.

No comments: