Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!postnews.google.com!26g2000yqk.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: gui push button
Date: Thu, 2 Jul 2009 12:41:48 -0700 (PDT)
Organization: http://groups.google.com
Lines: 13
Message-ID: <6ef240ee-5e04-4805-8b74-524dfa9fd0d2@26g2000yqk.googlegroups.com>
References: <h2j0ke$a5b$1@fred.mathworks.com>
NNTP-Posting-Host: 192.44.136.113
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1246563708 3638 127.0.0.1 (2 Jul 2009 19:41:48 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 2 Jul 2009 19:41:48 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 26g2000yqk.googlegroups.com; posting-host=192.44.136.113; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
	3.5.21022),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
Xref: news.mathworks.com comp.soft-sys.matlab:552519


On Jul 2, 3: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.

------------------------------------------------------
Which workspace?  In addition to the "global" workspace, the callback
function of the button has it's own workspace with its own local
scoped variables.  You can use "clear all" to clear these local
variables, but it seems risky since some variables are input arguments
of the callback routine.  If you want to delete some variables in the
"global" workspace I think you might have to declare them with the
global command in your callback first so that the "clear" command can
see them.  There might be another way that I don't know about though.