<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Controlling Warning Messages and State</title>
	<atom:link href="http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Mon, 13 Feb 2012 13:24:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-32008</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Fri, 04 Feb 2011 12:48:52 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-32008</guid>
		<description>JonG-

Look at the help for warning: http://www.mathworks.com/help/techdoc/ref/warning.html (has optional inputs for formatting and placing values into the string) (see example 2) or you can use sprintf for the string.

--Loren</description>
		<content:encoded><![CDATA[<p>JonG-</p>
<p>Look at the help for warning: <a href="http://www.mathworks.com/help/techdoc/ref/warning.html" rel="nofollow">http://www.mathworks.com/help/techdoc/ref/warning.html</a> (has optional inputs for formatting and placing values into the string) (see example 2) or you can use sprintf for the string.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JonG</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-32007</link>
		<dc:creator>JonG</dc:creator>
		<pubDate>Fri, 04 Feb 2011 09:49:57 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-32007</guid>
		<description>Hi Loren

how can I put dynamically defined text into a warning message, e.g.
warning(&#039;File:NotFound&#039;, ... 
 [&#039;Input file in location: \n&#039;, pwd, &#039;\&#039;, myfilename, &#039;\n was not found. Defaults being used insted&#039;])</description>
		<content:encoded><![CDATA[<p>Hi Loren</p>
<p>how can I put dynamically defined text into a warning message, e.g.<br />
warning(&#8216;File:NotFound&#8217;, &#8230;<br />
 ['Input file in location: \n', pwd, '\', myfilename, '\n was not found. Defaults being used insted'])</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-31965</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Sat, 15 Jan 2011 12:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-31965</guid>
		<description>Janice-

As far as I can tell, if a warning is off, it just means the warning won&#039;t be displayed, but lastwarn still gets updated.  I don&#039;t think there&#039;s a way around that.

--Loren</description>
		<content:encoded><![CDATA[<p>Janice-</p>
<p>As far as I can tell, if a warning is off, it just means the warning won&#8217;t be displayed, but lastwarn still gets updated.  I don&#8217;t think there&#8217;s a way around that.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Janice</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-31964</link>
		<dc:creator>Janice</dc:creator>
		<pubDate>Thu, 13 Jan 2011 16:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-31964</guid>
		<description>Thank you for the quick reply!

I need a way to &#039;record&#039; messages/warnings from several functions.
The reason I need this is as follows:

I have a big application with several &#039;jobs&#039; where each job logs its succes/failure and a message to a database table at the end. Some &#039;failures in the application are critical and cause an error. In this case the app terminates and i write the lasterr to the database. This is no problem because there can be only one &#039;error&#039; since that ends the job.

Some things are bad, but not critical, and I have programme a specific warning mesages in the code. Howver, there can be more than one such &#039;warning&#039; over the runtime, but all these non-critical &#039;warning messages&#039; still need to be stored in the datatbase table at the very end. 
 Obviously, lastwarn doesnt work natively for this purpose because it only gives me the last warning.

Of course, I could define my own global variable called &#039;my_message&#039; or something like that and write all my warnings to that variable. But this seems rather clumsy and I wanted to use Matlab&#039;s built-in error/warning capabilities for this as described above. I would need a function like &#039;allwarn&#039; (with corresponding &#039;allwarn reset&#039;).

Alternative: If I turn off a warning, is there a way to make sure that it also does not change the content of lastwarn? Then I could just turn off all Matlab-built-in warnings and &#039;keep&#039; only the ones I issed.

Thank you for your help!
Janice</description>
		<content:encoded><![CDATA[<p>Thank you for the quick reply!</p>
<p>I need a way to &#8216;record&#8217; messages/warnings from several functions.<br />
The reason I need this is as follows:</p>
<p>I have a big application with several &#8216;jobs&#8217; where each job logs its succes/failure and a message to a database table at the end. Some &#8216;failures in the application are critical and cause an error. In this case the app terminates and i write the lasterr to the database. This is no problem because there can be only one &#8216;error&#8217; since that ends the job.</p>
<p>Some things are bad, but not critical, and I have programme a specific warning mesages in the code. Howver, there can be more than one such &#8216;warning&#8217; over the runtime, but all these non-critical &#8216;warning messages&#8217; still need to be stored in the datatbase table at the very end.<br />
 Obviously, lastwarn doesnt work natively for this purpose because it only gives me the last warning.</p>
<p>Of course, I could define my own global variable called &#8216;my_message&#8217; or something like that and write all my warnings to that variable. But this seems rather clumsy and I wanted to use Matlab&#8217;s built-in error/warning capabilities for this as described above. I would need a function like &#8216;allwarn&#8217; (with corresponding &#8216;allwarn reset&#8217;).</p>
<p>Alternative: If I turn off a warning, is there a way to make sure that it also does not change the content of lastwarn? Then I could just turn off all Matlab-built-in warnings and &#8216;keep&#8217; only the ones I issed.</p>
<p>Thank you for your help!<br />
Janice</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-31963</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Thu, 13 Jan 2011 16:08:04 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-31963</guid>
		<description>Janice-

I don&#039;t know of a good way.  You could use the diary function and then parse what goes to the command window for warnings, but I don&#039;t know if it will catch all of them, besides being tedious.

Out of curiosity, why do you need all the warnings?

--Loren</description>
		<content:encoded><![CDATA[<p>Janice-</p>
<p>I don&#8217;t know of a good way.  You could use the diary function and then parse what goes to the command window for warnings, but I don&#8217;t know if it will catch all of them, besides being tedious.</p>
<p>Out of curiosity, why do you need all the warnings?</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Janice</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-31962</link>
		<dc:creator>Janice</dc:creator>
		<pubDate>Thu, 13 Jan 2011 15:59:21 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-31962</guid>
		<description>Hi Loren,
I have a problem I cannot seem to solve:
I would like to keep track of all warnings that have been issued while a certain application runs, not just the last one (as with lastwarn).
For my own warnings, I can do this by always concatenating..

&lt;pre&gt;
warning([lastwarn &#039; Additional warning message.&#039; ])
&lt;/pre&gt;

and get all the warning messages at the end with lastwarn.
However, if there are any warnings thrown by Matlab itself,
this will delete the stack.

How do I get all warnings?</description>
		<content:encoded><![CDATA[<p>Hi Loren,<br />
I have a problem I cannot seem to solve:<br />
I would like to keep track of all warnings that have been issued while a certain application runs, not just the last one (as with lastwarn).<br />
For my own warnings, I can do this by always concatenating..</p>
<pre>
warning([lastwarn ' Additional warning message.' ])
</pre>
<p>and get all the warning messages at the end with lastwarn.<br />
However, if there are any warnings thrown by Matlab itself,<br />
this will delete the stack.</p>
<p>How do I get all warnings?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-31273</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Thu, 15 Apr 2010 11:27:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-31273</guid>
		<description>Sunny-

I am not aware of any way of doing that without changing your code to check for warnings each step along the way.

--Loren</description>
		<content:encoded><![CDATA[<p>Sunny-</p>
<p>I am not aware of any way of doing that without changing your code to check for warnings each step along the way.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sunny Billava</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-31272</link>
		<dc:creator>Sunny Billava</dc:creator>
		<pubDate>Thu, 15 Apr 2010 08:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-31272</guid>
		<description>Hi Loren,

Can we trace down all the warning messages(in a cell array), that appear on the command prompt after running a model simulation?

-Sunny</description>
		<content:encoded><![CDATA[<p>Hi Loren,</p>
<p>Can we trace down all the warning messages(in a cell array), that appear on the command prompt after running a model simulation?</p>
<p>-Sunny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SAM</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-30816</link>
		<dc:creator>SAM</dc:creator>
		<pubDate>Thu, 19 Nov 2009 04:44:33 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-30816</guid>
		<description>Loren-

The code is already in Try/Catch block and the message still prompts on command prompt.

I have tried to set the following property:
MCRComponentState.MCC_ContourPlot_Lib_NET_set_warning_state

But its not working.

It would really help me if I can find out the appropriate syntax for suppressing all error messages.


Thanks,
Sam.</description>
		<content:encoded><![CDATA[<p>Loren-</p>
<p>The code is already in Try/Catch block and the message still prompts on command prompt.</p>
<p>I have tried to set the following property:<br />
MCRComponentState.MCC_ContourPlot_Lib_NET_set_warning_state</p>
<p>But its not working.</p>
<p>It would really help me if I can find out the appropriate syntax for suppressing all error messages.</p>
<p>Thanks,<br />
Sam.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/#comment-30813</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 18 Nov 2009 14:48:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=59#comment-30813</guid>
		<description>SAM-

I have no idea.  It&#039;s possible that putting the code inside a try/catch will be part of the solution.  I don&#039;t know VB so I don&#039;t know if you can call make a call and get the status - if that&#039;s available, it may also help.

--Loren</description>
		<content:encoded><![CDATA[<p>SAM-</p>
<p>I have no idea.  It&#8217;s possible that putting the code inside a try/catch will be part of the solution.  I don&#8217;t know VB so I don&#8217;t know if you can call make a call and get the status &#8211; if that&#8217;s available, it may also help.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
</channel>
</rss>

