Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!postnews.google.com!t11g2000prh.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: gui push button
Date: Thu, 2 Jul 2009 13:07:34 -0700 (PDT)
Organization: http://groups.google.com
Lines: 32
Message-ID: <39e89a1d-56f2-4ff3-8ff3-e6d32272b3be@t11g2000prh.googlegroups.com>
References: <h2j0ke$a5b$1@fred.mathworks.com> <fda3aff9-37bc-43d2-8865-8b70c4350e1e@2g2000prl.googlegroups.com> 
	<0d87e592-b25c-41a3-ba42-c27a5b03f53f@g1g2000pra.googlegroups.com>
NNTP-Posting-Host: 198.206.219.33
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1246565254 9009 127.0.0.1 (2 Jul 2009 20:07:34 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 2 Jul 2009 20:07:34 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: t11g2000prh.googlegroups.com; posting-host=198.206.219.33; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) 
	Gecko/20090624 Firefox/3.5,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 wwwproxy-son-ca-01.ca.sandia.gov:80 (squid/2.5.STABLE14)
Xref: news.mathworks.com comp.soft-sys.matlab:552530


On Jul 2, 12:59 pm, Eli <echmo...@gmail.com> wrote:
> On Jul 2, 12:45 pm, Nathan <ngrec...@gmail.com> wrote:
>
> > On Jul 2, 12:09 pm, "Eli Chmouni" <echmo...@gmail.com> wrote:
>
> > > 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.
>
> > handle = uicontrol('Style','pushbutton','String','Clear',...
> > 'Units','normalized','Position',[.25 .25 .5 .5],'Callback','clear');
>
> > It's simpler using GUIDE, but there's some code for you to mess around
> > with.
>
> > -Nathan
>
> Hello Nathan
> yes i am using Guide and i created a push button but i cannot figure
> out the code that i need to write in the push button callback . I have
> variable values in the matlab workspace and i want to clear them . If
> i was using the command window i would just write clear so i need that
> code that performs the same operation from a push button in the gui
> thx

All you put in the Callback is 'clear'. That is the code. I don't know
what's got you so confused...

Clear is the command. It works in m-files as well as in the command
window.

Give it a try.
-Nathan