[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: load file
From: |
Dmitri A. Sergatskov |
Subject: |
Re: load file |
Date: |
Wed, 24 Mar 2004 14:40:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 |
Geraint Paul Bevan wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Guanglei Cui wrote:
| Hi,
|
| When I use load to open a file, is there a way to use the content of a
| variable as the filename? For example,
|
| a="file.dat";
| load a; ## will load a file called file.dat
|
| Thanks in advance.
|
| Guanglei
|
octave:1> file="file.dat";
octave:2> eval (sprintf ("load %s", file));
That will work, but
octave:2> x = load(file);
looks more straightforward to me.
- --
Geraint Bevan
Regards,
Dmitri.
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- load file, Guanglei Cui, 2004/03/24
- Re: load file, Geraint Paul Bevan, 2004/03/24
- Re: load file,
Dmitri A. Sergatskov <=