<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169400</link>
    <title>MATLAB Central Newsreader - How can delete a msgbox in a function</title>
    <description>Feed for thread: How can delete a msgbox in a function</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 16 May 2008 14:11:01 -0400</pubDate>
      <title>How can delete a msgbox in a function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169400#432503</link>
      <author>Frank Pezzulo</author>
      <description>Dear All,&lt;br&gt;
&lt;br&gt;
I have a function that have at the end a msgbox. When i call&lt;br&gt;
this function in one way i want to show this msgbox, but if&lt;br&gt;
i call function in another way i don't want to show it. How&lt;br&gt;
i can call the function without show msgbox?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
Francesco&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 16 May 2008 17:28:18 -0400</pubDate>
      <title>Re: How can delete a msgbox in a function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169400#432560</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g0k4ll$mq7$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Frank Pezzulo &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;I have a function that have at the end a msgbox. When i call&lt;br&gt;
&amp;gt;this function in one way i want to show this msgbox, but if&lt;br&gt;
&amp;gt;i call function in another way i don't want to show it. How&lt;br&gt;
&amp;gt;i can call the function without show msgbox?&lt;br&gt;
&lt;br&gt;
Sorry, I am not clear on what you mean by calling the function&lt;br&gt;
"in another way".&lt;br&gt;
&lt;br&gt;
If there is a way that you can determine by examining the input&lt;br&gt;
arguments that the function was called one way or the other, then&lt;br&gt;
you just wrap the msgbox() call within an if/end pair that does&lt;br&gt;
the appropriate test.&lt;br&gt;
-- &lt;br&gt;
'Roberson' is my family name; my given name is 'Walter'.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 12:37:01 -0400</pubDate>
      <title>Re: How can delete a msgbox in a function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169400#432651</link>
      <author>Frank Pezzulo</author>
      <description>Hi Walter,&lt;br&gt;
&lt;br&gt;
thanks for your reply. In total i call function 2 times. One&lt;br&gt;
time i want show msgbox, the second one i call same function&lt;br&gt;
but this time i don't want msgbox. Let me know if there is a&lt;br&gt;
simple way to do it.&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
Francesco&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;g0kg7i$206$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;g0k4ll$mq7$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; Frank Pezzulo &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;I have a function that have at the end a msgbox. When i call&lt;br&gt;
&amp;gt; &amp;gt;this function in one way i want to show this msgbox, but if&lt;br&gt;
&amp;gt; &amp;gt;i call function in another way i don't want to show it. How&lt;br&gt;
&amp;gt; &amp;gt;i can call the function without show msgbox?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sorry, I am not clear on what you mean by calling the function&lt;br&gt;
&amp;gt; "in another way".&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If there is a way that you can determine by examining the&lt;br&gt;
input&lt;br&gt;
&amp;gt; arguments that the function was called one way or the&lt;br&gt;
other, then&lt;br&gt;
&amp;gt; you just wrap the msgbox() call within an if/end pair that&lt;br&gt;
does&lt;br&gt;
&amp;gt; the appropriate test.&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; 'Roberson' is my family name; my given name is 'Walter'.&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 17 May 2008 14:43:01 -0400</pubDate>
      <title>Re: How can delete a msgbox in a function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169400#432660</link>
      <author>us</author>
      <description>"Frank Pezzulo":&lt;br&gt;
&amp;lt;SNIP tired of his/her own messages...&lt;br&gt;
&lt;br&gt;
&amp;gt; In total i call function 2 times. One&lt;br&gt;
&amp;gt; time i want show msgbox, the second one i call same &lt;br&gt;
function but this time i don't want msgbox....&lt;br&gt;
&lt;br&gt;
one of the many solutions is outlined below&lt;br&gt;
- copy/paste the snippet into a file &amp;lt;foo.m&amp;gt;&lt;br&gt;
- at the command prompt, repeatedly type foo, eg,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foo % &amp;lt;- shows msg&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foo % &amp;lt;- does not show msg&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foo % &amp;lt;- shows msg&lt;br&gt;
&lt;br&gt;
function foo&lt;br&gt;
if   ~isempty(getappdata(0,'hasbox'))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setappdata(0,'hasbox',[]);&lt;br&gt;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;msgbox('text','string');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setappdata(0,'hasbox',true);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
us&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
