<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164196</link>
    <title>MATLAB Central Newsreader - basic question re: workspace variables and functions</title>
    <description>Feed for thread: basic question re: workspace variables and functions</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>Wed, 20 Feb 2008 18:28:01 -0500</pubDate>
      <title>basic question re: workspace variables and functions</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164196#416375</link>
      <author>Bryan</author>
      <description>hi all,&lt;br&gt;
&lt;br&gt;
how do i make a function aware of the variables in my matlab&lt;br&gt;
desktop workspace?  i am trying to figure out how to get a&lt;br&gt;
function to do something with a set of workspace variables,&lt;br&gt;
without having to explicitly pass each variable as an input&lt;br&gt;
argument to the function.  the reason for this is, for&lt;br&gt;
example, i may have a lot of 'data*' variables (where * is&lt;br&gt;
some further identifier, like a datenum or something), and i&lt;br&gt;
want my function to get all the 'data*' variables, and do&lt;br&gt;
something with them.  i was thinking to use assignin, but i&lt;br&gt;
cannot figure out how to do so, given that if i try and find&lt;br&gt;
the workspace variables in my function using something like&lt;br&gt;
&lt;br&gt;
datVars = who('data*');&lt;br&gt;
&lt;br&gt;
the function returns datVars as an empty array.  i am quite&lt;br&gt;
sure this is something basic, but i have looked around and&lt;br&gt;
am still confused.&lt;br&gt;
&lt;br&gt;
regards,&lt;br&gt;
bryan</description>
    </item>
    <item>
      <pubDate>Wed, 20 Feb 2008 18:52:02 -0500</pubDate>
      <title>Re: basic question re: workspace variables and functions</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164196#416381</link>
      <author>Ilya Rozenfeld</author>
      <description>Try to use &quot;evalin&quot;  e.g.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
datVars = evalin('base', 'who(''data*'')');&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Bryan &quot; &amp;lt;cssmwbs@gmail.com&amp;gt; wrote in message &amp;lt;fphrfh$4l8&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hi all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; how do i make a function aware of the variables in my &lt;br&gt;
matlab&lt;br&gt;
&amp;gt; desktop workspace?  i am trying to figure out how to get &lt;br&gt;
a&lt;br&gt;
&amp;gt; function to do something with a set of workspace &lt;br&gt;
variables,&lt;br&gt;
&amp;gt; without having to explicitly pass each variable as an &lt;br&gt;
input&lt;br&gt;
&amp;gt; argument to the function.  the reason for this is, for&lt;br&gt;
&amp;gt; example, i may have a lot of 'data*' variables (where * &lt;br&gt;
is&lt;br&gt;
&amp;gt; some further identifier, like a datenum or something), &lt;br&gt;
and i&lt;br&gt;
&amp;gt; want my function to get all the 'data*' variables, and do&lt;br&gt;
&amp;gt; something with them.  i was thinking to use assignin, &lt;br&gt;
but i&lt;br&gt;
&amp;gt; cannot figure out how to do so, given that if i try and &lt;br&gt;
find&lt;br&gt;
&amp;gt; the workspace variables in my function using something &lt;br&gt;
like&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; datVars = who('data*');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; the function returns datVars as an empty array.  i am &lt;br&gt;
quite&lt;br&gt;
&amp;gt; sure this is something basic, but i have looked around &lt;br&gt;
and&lt;br&gt;
&amp;gt; am still confused.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; regards,&lt;br&gt;
&amp;gt; bryan</description>
    </item>
    <item>
      <pubDate>Wed, 20 Feb 2008 19:46:02 -0500</pubDate>
      <title>Re: basic question re: workspace variables and functions</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164196#416399</link>
      <author>Bryan</author>
      <description>&quot;Ilya Rozenfeld&quot; &amp;lt;rozeni.nospam@alum.rpi.edu&amp;gt; wrote in&lt;br&gt;
message &amp;lt;fphssi$nhb$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Try to use &quot;evalin&quot;  e.g.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; datVars = evalin('base', 'who(''data*'')');&lt;br&gt;
&lt;br&gt;
uggh, yes, that is the one i was looking for.  thanks so much!!&lt;br&gt;
&lt;br&gt;
bryan</description>
    </item>
  </channel>
</rss>

