<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247131</link>
    <title>MATLAB Central Newsreader - Clear Empty Variables in Workspace</title>
    <description>Feed for thread: Clear Empty Variables in Workspace</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>Fri, 20 Mar 2009 13:13:01 -0400</pubDate>
      <title>Clear Empty Variables in Workspace</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247131#636407</link>
      <author>Eric </author>
      <description>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 &amp; Matlab creates an empty cell array.&lt;br&gt;
&lt;br&gt;
Does anyone have a script to loop through the variables in the workspace &amp; clear the ones that meet a certain criteria?&lt;br&gt;
&lt;br&gt;
I need to remove variables that meet the criteria below:&lt;br&gt;
1) max value in array is zero&lt;br&gt;
2) all cells are empty&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Eric</description>
    </item>
    <item>
      <pubDate>Mon, 23 Mar 2009 15:48:30 -0400</pubDate>
      <title>Re: Clear Empty Variables in Workspace</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247131#636980</link>
      <author>Ashish Uthama</author>
      <description>On Fri, 20 Mar 2009 09:13:01 -0400, Eric   &lt;br&gt;
&amp;lt;edette1remove.this1rman@comcast.net&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; This is probably a trivial question but.........I am working on a  &lt;br&gt;
&amp;gt; project that queries a SQL database and if there are no records found  &lt;br&gt;
&amp;gt; for the query, it returns an empty record set &amp; Matlab creates an empty  &lt;br&gt;
&amp;gt; cell array.&lt;br&gt;
&lt;br&gt;
Why not check the return value and clear it if it matches your conditions?&lt;br&gt;
&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Does anyone have a script to loop through the variables in the workspace  &lt;br&gt;
&amp;gt; &amp; clear the ones that meet a certain criteria?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I need to remove variables that meet the criteria below:&lt;br&gt;
&amp;gt; 1) max value in array is zero&lt;br&gt;
&amp;gt; 2) all cells are empty&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; Eric&lt;br&gt;
&lt;br&gt;
If you _have_ to do this, you might want to look at&lt;br&gt;
WHO   - to get a list of your workspace variables&lt;br&gt;
EVAL  - to run your conditions on the variable names&lt;br&gt;
CLEAR - ...&lt;br&gt;
&lt;br&gt;
EVAL is a 'no-no' in CSSSM, but I cant think of another way.&lt;br&gt;
I would suggest trying something along the lines of my suggestion above.</description>
    </item>
  </channel>
</rss>

