[Top][All Lists]

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

Re: loading a filename beginning with a digit

From: Mike Miller
Subject: Re: loading a filename beginning with a digit
Date: Sun, 20 Jul 2003 22:28:52 -0500 (CDT)

On Sun, 20 Jul 2003, John W. Eaton wrote:

> Hmm.  Octave 2.1.50 creates a variables called X2x instead so that it
> will have a valid variable name.
> Also, with reasonably recent versions you can use
>   some_other_name = load ("2x.txt");

I wish I'd known about that last one.  I wanted to create a function
called "loadfile" that would allow me to do exactly that sort of thing,
but even in somewhat older versions of Octave.  The thing we were starting
on is immediately below, but I'm sure it's pretty bad.

function newmatrix = loadfile(filename)

dfi = do_fortran_indexing;
do_fortran_indexing =1;
result = split(filename,".");
newmatrix =eval(result(1,:));
do_fortran_indexing =dfi;

Now I suddenly see that there is a function by Kurt Hornik called "aload"
(copyright 1997) on one of my systems, but I doesn't work for me with
Octave 2.0.14.

## Author:  KH <address@hidden>
## Description:  Load from a flat ASCII data file

function x = aload (filename, cw, rw, FS, NA, ignore_regexp)



Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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