Warnings do not turn off
Ältere Kommentare anzeigen
Hi,
I'm having an issue with warnings not turning off. I've tried the more general solution of
warning off;
and also to query the warning (in this case, it's 'MATLAB:interp1:NaNstrip'), and it will say the warning is off (after I either turn it off with a general command or turning the command off specifically using its id). But the warning still displays every time I run my script. Is it perhaps due to the fact that I am calling another function within my script, which is causing the warning, and my current session somehow is not getting through to the location of that script?
I can type
>> warning('query','last')
The state of warning 'MATLAB:interp1:NaNstrip' is 'off'.
But it literally JUST threw the warning at me a second ago when I ran my script. Clearly I am missing something here. I just want to turn off these warnings as they take up a lot of space in the command window and I want to be able to keep track of more important things that I actually told it to display.
5 Kommentare
Chaya N
am 26 Okt. 2016
That syntax should be
warning('off')
Aaron Anderson
am 26 Okt. 2016
Bearbeitet: Aaron Anderson
am 26 Okt. 2016
the cyclist
am 27 Okt. 2016
Bearbeitet: the cyclist
am 27 Okt. 2016
Can you post a simple example of a script that we can run, that exhibits the behavior you are experiencing?
Kirby Fears
am 27 Okt. 2016
Does it display the line number where the error is thrown? Do you have any other info you can share, such as your exact function call and the data you're passing in? I'd like to reproduce the same behavior on my computer.
Walter Roberson
am 27 Okt. 2016
Chaya N,
warning('off')
and
warning off
are exactly the same. See https://www.mathworks.com/help/matlab/matlab_prog/command-vs-function-syntax.html
Akzeptierte Antwort
Weitere Antworten (1)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!