<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172105</link>
    <title>MATLAB Central Newsreader - parameterize filename</title>
    <description>Feed for thread: parameterize 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>Sun, 06 Jul 2008 16:02:02 -0400</pubDate>
      <title>parameterize filename</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172105#441399</link>
      <author>GG </author>
      <description>Hi, Is there a way to parameterize a filename in matlab?&lt;br&gt;
&lt;br&gt;
For example, if I have 100 text files (file1.txt, &lt;br&gt;
file2.txt ... file100.txt), and I want to process each &lt;br&gt;
similarly, I'd like to write a loop such as,&lt;br&gt;
&lt;br&gt;
for i=1:100&lt;br&gt;
&amp;nbsp;&amp;nbsp;load file(i).txt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;data = file(i)' - mean( file(i) );&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
The reason I need to do it this way is the file size is so &lt;br&gt;
large I run into out-of-memory issues if I load it in as &lt;br&gt;
one big file, so I've broken it up into many smaller files.&lt;br&gt;
&lt;br&gt;
Thanks in advance, -GG</description>
    </item>
    <item>
      <pubDate>Sun, 06 Jul 2008 17:06:08 -0400</pubDate>
      <title>Re: parameterize filename</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172105#441401</link>
      <author>Lothar Schmidt</author>
      <description>GG schrieb:&lt;br&gt;
&amp;gt; Hi, Is there a way to parameterize a filename in matlab?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; For example, if I have 100 text files (file1.txt, &lt;br&gt;
&amp;gt; file2.txt ... file100.txt), and I want to process each &lt;br&gt;
&amp;gt; similarly, I'd like to write a loop such as,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; for i=1:100&lt;br&gt;
&amp;gt;   load file(i).txt;&lt;br&gt;
&amp;gt;   data = file(i)' - mean( file(i) );&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The reason I need to do it this way is the file size is so &lt;br&gt;
&amp;gt; large I run into out-of-memory issues if I load it in as &lt;br&gt;
&amp;gt; one big file, so I've broken it up into many smaller files.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance, -GG&lt;br&gt;
&lt;br&gt;
for i=1:100&lt;br&gt;
	filename=['file' num2str(i) '.txt'];&lt;br&gt;
	data=readfunction(filename);&lt;br&gt;
&lt;br&gt;
	result=dowatheveryouwantto(data);&lt;br&gt;
	perhapsoutputfunction(result);&lt;br&gt;
end</description>
    </item>
    <item>
      <pubDate>Mon, 07 Jul 2008 15:02:25 -0400</pubDate>
      <title>Re: parameterize filename</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172105#441561</link>
      <author>Peter Boettcher</author>
      <description>&quot;GG &quot; &amp;lt;ggkmath@comcast.net&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; Hi, Is there a way to parameterize a filename in matlab?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; For example, if I have 100 text files (file1.txt, &lt;br&gt;
&amp;gt; file2.txt ... file100.txt), and I want to process each &lt;br&gt;
&amp;gt; similarly, I'd like to write a loop such as,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; for i=1:100&lt;br&gt;
&amp;gt;   load file(i).txt;&lt;br&gt;
&amp;gt;   data = file(i)' - mean( file(i) );&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The reason I need to do it this way is the file size is so &lt;br&gt;
&amp;gt; large I run into out-of-memory issues if I load it in as &lt;br&gt;
&amp;gt; one big file, so I've broken it up into many smaller files.&lt;br&gt;
&lt;br&gt;
for i=1:100&lt;br&gt;
&amp;nbsp;&amp;nbsp;filename = sprintf('file%i.txt', i);&lt;br&gt;
&amp;nbsp;&amp;nbsp;data = load(filename);&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;processed_data = data' - mean(data);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
  </channel>
</rss>

