Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Clear Empty Variables in Workspace
Date: Fri, 20 Mar 2009 13:13:01 +0000 (UTC)
Organization: none
Lines: 10
Message-ID: <gq04ot$it3$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237554781 19363 172.30.248.38 (20 Mar 2009 13:13:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 20 Mar 2009 13:13:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1171182
Xref: news.mathworks.com comp.soft-sys.matlab:526409


This is probably a trivial question but.........I am working on a project that queries a SQL database and if there are no records found for the query, it returns an empty record set & Matlab creates an empty cell array.

Does anyone have a script to loop through the variables in the workspace & clear the ones that meet a certain criteria?

I need to remove variables that meet the criteria below:
1) max value in array is zero
2) all cells are empty

Thanks,
Eric