Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re:
Date: Mon, 3 Sep 2007 08:47:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <fbghm6$psi$1@fred.mathworks.com>
References: <fbf96u$i98$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1188809222 26514 172.30.248.37 (3 Sep 2007 08:47:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 3 Sep 2007 08:47:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870065
Xref: news.mathworks.com comp.soft-sys.matlab:426738



"Francesco " <fsarnari@maths.leeds.ac.uk> wrote in message
<fbf96u$i98$1@fred.mathworks.com>...
> <SNIP ... make a filename string from a number to use for load

You can use the functional format of LOAD, which accepts a
variable string as its input. You can create the contents of
the variable string on the fly. For that you can use
NUM2STR, STRCAT and [], but I found that SPRINTF is most
flexible:

i = 1 ;
varstring = sprintf('file%03d.txt',i) 
load (varstring)

hth
Jos