Home > Enterprise >  Turning off warnings in Octave
Turning off warnings in Octave

Time:06-21

I am running a Matlab compatible script in Octave, so I was awaiting few warnings concerning the '&' and '|' commands and others, so I added the "warning('all','off')" in my now Octave script, but it doesn't seem to do anything... I don't get it, I still get the same warnings!

Any ideas how to solve this please?

PS: I am running the Octave script in batch mode.

CodePudding user response:

It should be warning('off','all') or just warning('off'), your arguments are inverted.

Docs: https://octave.sourceforge.io/octave/function/warning.html

warning ("off", id)

If the first argument is "on" or "off", set the state of a particular warning using the identifier id. If the first argument is "query", query the state of this warning instead. If the identifier is omitted, a value of "all" is assumed.


Obligatory note that it's probably a better idea to address the warnings than turn them off, and that you should at least re-enable the warnings after specific functions where you want to ignore them.

  • Related