Path: news.mathworks.com!not-for-mail
From: "GG " <ggkmath@comcast.net>
Newsgroups: comp.soft-sys.matlab
Subject: parameterize filename
Date: Sun, 6 Jul 2008 16:02:02 +0000 (UTC)
Organization: Jittertime Consulting
Lines: 16
Message-ID: <g4qq9q$o92$1@fred.mathworks.com>
Reply-To: "GG " <ggkmath@comcast.net>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1215360122 24866 172.30.248.37 (6 Jul 2008 16:02:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 6 Jul 2008 16:02:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1432308
Xref: news.mathworks.com comp.soft-sys.matlab:477753



Hi, Is there a way to parameterize a filename in matlab?

For example, if I have 100 text files (file1.txt, 
file2.txt ... file100.txt), and I want to process each 
similarly, I'd like to write a loop such as,

for i=1:100
  load file(i).txt;
  data = file(i)' - mean( file(i) );
end

The reason I need to do it this way is the file size is so 
large I run into out-of-memory issues if I load it in as 
one big file, so I've broken it up into many smaller files.

Thanks in advance, -GG