Thread Subject: suppress warning messages

Subject: suppress warning messages

From: Juliette Salexa

Date: 7 Jul, 2009 22:29:02

Message: 1 of 6

I can't find a way from the m-file editor to force matlab not to give me warning messages. semicolon doesn't do this.. is there a way ??

Subject: suppress warning messages

From: Dan Pearce

Date: 7 Jul, 2009 23:04:01

Message: 2 of 6

> I can't find a way from the m-file editor to force matlab not to give me warning messages. semicolon doesn't do this.. is there a way ??

help warning

WARNING('OFF', 'MSGID') and WARNING('ON', 'MSGID') disable and enable the display of any warning tagged with message identifier MSGID. (Use LASTWARN to determine the identifier of a warning, or use the WARNING VERBOSE feature

Subject: suppress warning messages

From: Steven Lord

Date: 8 Jul, 2009 02:40:25

Message: 3 of 6


"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message
news:h30i7e$c87$1@fred.mathworks.com...
>I can't find a way from the m-file editor to force matlab not to give me
>warning messages. semicolon doesn't do this.. is there a way ??

Do you mean that you don't know how to suppress warnings that are thrown
when you run your code, or you don't know how to suppress M-Lint messages in
the Editor?

Dan has told you how to enable/disable warnings (although you shouldn't
blindly turn off warnings -- usually they're thrown for a reason.)

To suppress M-Lint messages, read this:

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/brqxeeu-151.html#brqxeeu-167

But again, don't just blindly suppress M-Lint messages -- only suppress a
message if you understand what it means and why your code is causing it.

--
Steve Lord
slord@mathworks.com

Subject: suppress warning messages

From: Juliette Salexa

Date: 9 Jul, 2009 18:12:01

Message: 4 of 6

Thank you Dan,
I think I'm doing something wrong here:

Warning: Unable to interpret TeX string
> In title at 41
  In title at 23
>> LASTWARN
??? Undefined function or variable 'LASTWARN'.
>> WARNING ON VERBOSE
??? Undefined function or method 'WARNING' for input arguments of type 'char'.

so I can't find the message ID!

..
Thank you Steve for your concern. Yes I know what the warning is but because the line of code generating the warning is within a for loop, I'm getting the same message a million times and it's slowing my program.. yet I don't want to remove the code generating the warning because it's doing other important things and the warning can't be fixed on my version on matlab

R2007b

Subject: suppress warning messages

From: Steven Lord

Date: 9 Jul, 2009 21:33:24

Message: 5 of 6


"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message
news:h35btg$l96$1@fred.mathworks.com...
> Thank you Dan,
> I think I'm doing something wrong here:
>
> Warning: Unable to interpret TeX string
>> In title at 41
> In title at 23
>>> LASTWARN
> ??? Undefined function or variable 'LASTWARN'.
>>> WARNING ON VERBOSE
> ??? Undefined function or method 'WARNING' for input arguments of type
> 'char'.
>
> so I can't find the message ID!

Usually in the documentation and in the newsgroup, people write function
names in ALL CAPS simply to distinguish them from surrounding text. Use the
command "lastwarn" (without the quotes) or "warning on verbose" (also
without quotes.)

> Thank you Steve for your concern. Yes I know what the warning is but
> because the line of code generating the warning is within a for loop, I'm
> getting the same message a million times and it's slowing my program.. yet
> I don't want to remove the code generating the warning because it's doing
> other important things and the warning can't be fixed on my version on
> matlab
>
> R2007b

From the warning message, it looks like you're calling TITLE with a string
that appears to contain TeX code in it, but TITLE doesn't recognize the TeX
code.

Have you tried:

title('Invalid TeX c\ode', 'Interpreter', 'none')

--
Steve Lord
slord@mathworks.com

Subject: suppress warning messages

From: Juliette Salexa

Date: 9 Jul, 2009 21:50:16

Message: 6 of 6

Thank you everyone,

warning off MATLAB:tex;title(name(i));warning on MATLAB:tex;

worked.

But no, 'Interpreter','none' doesn't do the trick. It still thinks that name(i) is a TeX string since the y and x-axes are labeled using tex

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com