Path: news.mathworks.com!not-for-mail
From: "Koos Spee" <bmx_360@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Wavread loop: Variable filename
Date: Thu, 18 Sep 2008 09:24:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <gat6nh$c36$1@fred.mathworks.com>
Reply-To: "Koos Spee" <bmx_360@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1221729841 12390 172.30.248.35 (18 Sep 2008 09:24:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 18 Sep 2008 09:24:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1512748
Xref: news.mathworks.com comp.soft-sys.matlab:490736


Hello,

I have a set of (wav)files e.g.

file01.wav, file02.wav, file03.wav etc.

Now, I want to get load these files into Matlab with a loop and storing them into load01, load02, load03 etc

However I am not able to give them the correct filename. I tried for example:

for i=1:3
    StrI=int2str(i);
    WavName='file';
    WavStored='load';
    temp=strcat(WavName, StrI);
    strcat(WavStored, StrI)=wavread(temp);
end

Also looked into dir('*wav'), but that leads to the same problem