<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255211</link>
    <title>MATLAB Central Newsreader - gui push button</title>
    <description>Feed for thread: gui push button</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by 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>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 02 Jul 2009 19:09:02 -0400</pubDate>
      <title>gui push button</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255211#662330</link>
      <author>Eli Chmouni</author>
      <description>I have a gui and i want the code that i need to add to a gui push button to clear all the variables from the workspace.</description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 19:41:48 -0400</pubDate>
      <title>Re: gui push button</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255211#662344</link>
      <author>ImageAnalyst</author>
      <description>On Jul 2, 3:09&#160;pm, &quot;Eli Chmouni&quot; &amp;lt;echmo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I have a gui and i want the code that i need to add to a gui push button to clear all the variables from the workspace.&lt;br&gt;
&lt;br&gt;
------------------------------------------------------&lt;br&gt;
Which workspace?  In addition to the &quot;global&quot; workspace, the callback&lt;br&gt;
function of the button has it's own workspace with its own local&lt;br&gt;
scoped variables.  You can use &quot;clear all&quot; to clear these local&lt;br&gt;
variables, but it seems risky since some variables are input arguments&lt;br&gt;
of the callback routine.  If you want to delete some variables in the&lt;br&gt;
&quot;global&quot; workspace I think you might have to declare them with the&lt;br&gt;
global command in your callback first so that the &quot;clear&quot; command can&lt;br&gt;
see them.  There might be another way that I don't know about though.</description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 19:45:24 -0400</pubDate>
      <title>Re: gui push button</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255211#662346</link>
      <author>Nathan</author>
      <description>On Jul 2, 12:09&#160;pm, &quot;Eli Chmouni&quot; &amp;lt;echmo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I have a gui and i want the code that i need to add to a gui push button to clear all the variables from the workspace.&lt;br&gt;
&lt;br&gt;
handle = uicontrol('Style','pushbutton','String','Clear',...&lt;br&gt;
'Units','normalized','Position',[.25 .25 .5 .5],'Callback','clear');&lt;br&gt;
&lt;br&gt;
It's simpler using GUIDE, but there's some code for you to mess around&lt;br&gt;
with.&lt;br&gt;
&lt;br&gt;
-Nathan</description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 19:59:10 -0400</pubDate>
      <title>Re: gui push button</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255211#662350</link>
      <author>Eli</author>
      <description>On Jul 2, 12:45&#160;pm, Nathan &amp;lt;ngrec...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; On Jul 2, 12:09&#160;pm, &quot;Eli Chmouni&quot; &amp;lt;echmo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I have a gui and i want the code that i need to add to a gui push button to clear all the variables from the workspace.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; handle = uicontrol('Style','pushbutton','String','Clear',...&lt;br&gt;
&amp;gt; 'Units','normalized','Position',[.25 .25 .5 .5],'Callback','clear');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It's simpler using GUIDE, but there's some code for you to mess around&lt;br&gt;
&amp;gt; with.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; -Nathan&lt;br&gt;
&lt;br&gt;
Hello Nathan&lt;br&gt;
yes i am using Guide and i created a push button but i cannot figure&lt;br&gt;
out the code that i need to write in the push button callback . I have&lt;br&gt;
variable values in the matlab workspace and i want to clear them . If&lt;br&gt;
i was using the command window i would just write clear so i need that&lt;br&gt;
code that performs the same operation from a push button in the gui&lt;br&gt;
thx</description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 20:07:34 -0400</pubDate>
      <title>Re: gui push button</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255211#662355</link>
      <author>Nathan</author>
      <description>On Jul 2, 12:59&#160;pm, Eli &amp;lt;echmo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; On Jul 2, 12:45&#160;pm, Nathan &amp;lt;ngrec...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; On Jul 2, 12:09&#160;pm, &quot;Eli Chmouni&quot; &amp;lt;echmo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have a gui and i want the code that i need to add to a gui push button to clear all the variables from the workspace.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; handle = uicontrol('Style','pushbutton','String','Clear',...&lt;br&gt;
&amp;gt; &amp;gt; 'Units','normalized','Position',[.25 .25 .5 .5],'Callback','clear');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; It's simpler using GUIDE, but there's some code for you to mess around&lt;br&gt;
&amp;gt; &amp;gt; with.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; -Nathan&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hello Nathan&lt;br&gt;
&amp;gt; yes i am using Guide and i created a push button but i cannot figure&lt;br&gt;
&amp;gt; out the code that i need to write in the push button callback . I have&lt;br&gt;
&amp;gt; variable values in the matlab workspace and i want to clear them . If&lt;br&gt;
&amp;gt; i was using the command window i would just write clear so i need that&lt;br&gt;
&amp;gt; code that performs the same operation from a push button in the gui&lt;br&gt;
&amp;gt; thx&lt;br&gt;
&lt;br&gt;
All you put in the Callback is 'clear'. That is the code. I don't know&lt;br&gt;
what's got you so confused...&lt;br&gt;
&lt;br&gt;
Clear is the command. It works in m-files as well as in the command&lt;br&gt;
window.&lt;br&gt;
&lt;br&gt;
Give it a try.&lt;br&gt;
-Nathan</description>
    </item>
    <item>
      <pubDate>Fri, 03 Jul 2009 01:29:12 -0400</pubDate>
      <title>Re: gui push button</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255211#662411</link>
      <author>ImageAnalyst</author>
      <description>Again, you need to understand what I responded first.  What Nathan&lt;br&gt;
said will only clear the local scope variables that exist ONLY within&lt;br&gt;
that button's callback.  It will not clear any other variables in any&lt;br&gt;
other workspace, which means that it won't clear anything in the&lt;br&gt;
global workspace either.  I know - I just tested this to verify it.  I&lt;br&gt;
put a clear in the callback and it cleared only the local variables&lt;br&gt;
and those in the global workspace remained untouched.  If that's what&lt;br&gt;
you want, then fine, you're done, no problem.  I just mention this&lt;br&gt;
because it appears that you don't have a complete understanding of&lt;br&gt;
what &quot;workspace&quot; entails.</description>
    </item>
  </channel>
</rss>

