<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/166734</link>
    <title>MATLAB Central Newsreader - load a file into a variable name different than the filename</title>
    <description>Feed for thread: load a file into a variable name different than the filename</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>Tue, 01 Apr 2008 13:23:02 -0400</pubDate>
      <title>load a file into a variable name different than the filename</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/166734#423938</link>
      <author>David Doria</author>
      <description>I have a file myfile.txt that contains&lt;br&gt;
&lt;br&gt;
1 2 3&lt;br&gt;
4 5 6&lt;br&gt;
7 8 9&lt;br&gt;
&lt;br&gt;
If I say &lt;br&gt;
&lt;br&gt;
load 'myfile.txt'&lt;br&gt;
&lt;br&gt;
the result is a variable called myfile that contains the matrix.&lt;br&gt;
&lt;br&gt;
I would like to do something like&lt;br&gt;
&lt;br&gt;
load 'myfile.txt' mymatrix&lt;br&gt;
&lt;br&gt;
which produces a variable called mymatrix instead of myfile.&lt;br&gt;
&amp;nbsp;Is this possible?&lt;br&gt;
&lt;br&gt;
The reason is that if I have a loop that goes through a list&lt;br&gt;
of files, I'd like to have other code in the loop that can&lt;br&gt;
just reference mymatrix and not have to update to the&lt;br&gt;
current filename on every iteration.&lt;br&gt;
&lt;br&gt;
Please let me know.&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
&lt;br&gt;
David</description>
    </item>
    <item>
      <pubDate>Tue, 01 Apr 2008 13:28:02 -0400</pubDate>
      <title>Re: load a file into a variable name different than the filename</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/166734#423939</link>
      <author>David </author>
      <description>&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fstcvm$k7m$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a file myfile.txt that contains&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 1 2 3&lt;br&gt;
&amp;gt; 4 5 6&lt;br&gt;
&amp;gt; 7 8 9&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If I say &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; load 'myfile.txt'&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; the result is a variable called myfile that contains the &lt;br&gt;
matrix.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I would like to do something like&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; load 'myfile.txt' mymatrix&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; which produces a variable called mymatrix instead of &lt;br&gt;
myfile.&lt;br&gt;
&amp;gt;  Is this possible?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The reason is that if I have a loop that goes through a &lt;br&gt;
list&lt;br&gt;
&amp;gt; of files, I'd like to have other code in the loop that &lt;br&gt;
can&lt;br&gt;
&amp;gt; just reference mymatrix and not have to update to the&lt;br&gt;
&amp;gt; current filename on every iteration.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Please let me know.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; David&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
try &lt;br&gt;
mymatrix=load('myfile.txt');</description>
    </item>
    <item>
      <pubDate>Sun, 06 Apr 2008 15:27:01 -0400</pubDate>
      <title>Re: load a file into a variable name different than the filename</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/166734#424981</link>
      <author>David Doria</author>
      <description>works perfect... I always forget about the () notation for&lt;br&gt;
some commands.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Dave</description>
    </item>
  </channel>
</rss>

