Borrar filtros
Borrar filtros

Warnings do not turn off

15 visualizaciones (últimos 30 días)
Aaron Anderson
Aaron Anderson el 26 de Oct. de 2016
Respondida: Steven Lord el 27 de Oct. de 2016
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 comentarios
Kirby Fears
Kirby Fears el 27 de Oct. de 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
Walter Roberson el 27 de Oct. de 2016

Iniciar sesión para comentar.

Respuesta aceptada

Steven Lord
Steven Lord el 27 de Oct. de 2016
Make sure you haven't overloaded the warning or message functions.
Set an error breakpoint to stop whenever a warning is issued. When you reach that line, use warning query to check that the warning is still disabled.
If that doesn't work, turn warning verbosity and backtracing on as per the "Control Warning Verbosity" example on the warning documentation page and ensure you're in the file you think you're in.

Más respuestas (1)

Sophie
Sophie el 26 de Oct. de 2016
try
warning('off','all')
  1 comentario
Aaron Anderson
Aaron Anderson el 26 de Oct. de 2016
This is pretty much the same thing as warning off, I've tried this one too and it doesn't work. The warning is "off" but it still displays it. So somehow the function that is giving the warning is unaware that the warning is off.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by