[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave memory allocation problem ? (-> X = load ... )
From: |
Ted Harding |
Subject: |
Re: octave memory allocation problem ? (-> X = load ... ) |
Date: |
Thu, 20 Apr 1995 22:49:11 +0200 (BST) |
Hi John,
> Joao Cardoso <address@hidden> wrote:
>
> : In Matlab, the "load" returns the data contained in the file, and I
> : only need to do
> :
> : data = load -ascii file_name;
> :
> : Of course, in Octave, with multi-variable data files, this is not possible,
>
> I had no idea that this was the way load worked in Matlab. Perhaps
> Octave's load command could be modified to do something like
>
> # load the first three values from the file in the variables x, y,
> # and z.
>
> [x, y, z] = load foo
>
> With no output arguments, the behavior would remain the same as before.
>
> Does anyone see any problems with this change?
>
> Thanks,
>
> jwe
>
I never heard of this behaviour in MatLabs I'm familiar with.
In fact "load" would be parsed as a variable/function name and
the command would give an error. It is one of a class of commands
(including clear, delete, help, meta, save) whose "arguments" occur
as subsequent tokens (i.e. no parentheses): these would give the same
error.
However, supposing it worked, there's little point if the file
was saved from matlab in the first place, exept perhaps to avoid
over-writing a variable on "load" (i.e. load to a var with a
substitute name).
I would make the same comment about implementing something similar
in octave.
Now there /could/ be some point in " [x, y, z] = load foo "
if foo contained (e.g.) data in >= 3 columns as a flat ASCII table
(no variable or type info), simply a tableau, which would pick off
the first 3 cols and assign them to x, y and z: one could even
imagine taking a leaf from gnuplot's book with something like
" [x, y, z] = load foo using 1,3,7 "
if foo has data in >= 7 columns. However, I'm not suggesting this
too seriously ...
Ted. (address@hidden)
- octave memory allocation problem ?, Ludger Leushacke, 1995/04/19
- octave memory allocation problem ?, Joao Cardoso, 1995/04/19
- Re: octave memory allocation problem ?, John Eaton, 1995/04/20
- Re: octave memory allocation problem ?, John Eaton, 1995/04/20
- Re: octave memory allocation problem ?, Joao Cardoso, 1995/04/25
- Re: octave memory allocation problem ?, John Eaton, 1995/04/27
- Re: octave memory allocation problem ?, John Eaton, 1995/04/27
- Re: octave memory allocation problem ?, John Eaton, 1995/04/28