help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loading multiple datafile


From: Rafael Laboissiere
Subject: Re: loading multiple datafile
Date: Sat, 4 Nov 2006 13:05:21 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Tom Holroyd (NIH/NIMH) [E] <address@hidden> [2006-11-03 12:23]:

> s = ["file", num2str(i), ".dat"]
> load(s);
> 
> baptiste auguie wrote:
> > With Octave's load function, I can't seem to pass a filename I've  
> > constructed automatically. What would you suggest?


I much prefer this:

   s = sprintf ("file%d.dat", i);
   load (s);

Using sprintf allows me to do more powerful things as this:

   s = sprintf ("file%03d.dat", i);
 
and then access files with names file001.dat, file002.dat, ..., file037.dat,
etc.

-- 
Rafael


reply via email to

[Prev in Thread] Current Thread [Next in Thread]