[Top][All Lists]

[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

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)

reply via email to

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