Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: How to clear all variables except one or two
Date: Sat, 31 Jan 2009 23:40:17 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <gm2nh1$4hu$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1233445217 4670 172.30.248.35 (31 Jan 2009 23:40:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 31 Jan 2009 23:40:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1551459
Xref: news.mathworks.com comp.soft-sys.matlab:515192


I have a code that creates many variables and at each iteration I want to clear all the variables except for one or two. Is this possible without specifying clear A, clear B and so on for every variable?

I know clear all deletes them all but I need to keep one of them.

Thanks