[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "load" as both command and function
From: |
Robert A. Macy |
Subject: |
Re: "load" as both command and function |
Date: |
Mon, 28 Mar 2005 08:29:42 -0800 |
Hmm...never used it like that, but
>> save -ascii "filename.txt" var1 var2 var3 mixed;
always puts the variables away in readable format, then
>> load -force "filename.txt";
always brings all of the variables back OVERWRITING the
variables already being used and creating ones that weren't
there.
to make smaller file storage, I use
>> save "filename.bin" var1 var2 var3 mixed;
and bring that back with
>> load -force "filename.bin";
note I never had to tell the load function which format the
file was stored in to bring back the variables stored in
the file.
try the "load" without -force and watch what happens.
- Robert -
On Sun, 27 Mar 2005 22:30:11 -0600
"Edward C. Jones" <address@hidden> wrote:
> I found the following paragraph from the documentation
> for "load" to be difficult to understand:
>
> If invoked with a single output argument, Octave
> returns data
> instead of inserting variables in the symbol table.
> If the data
> file contains only numbers (TAB- or space-delimited
> columns), a
> matrix of values is returned. Otherwise, "load"
> returns a
> structure with members corresponding to the names
> of the variables
> in the file.
>
> A command cannot have an output argument. Only a function
> can. So we get:
>
> something = list('a', 'b', 'c')
> save -ascii "something.asc" something
> somethingelse = load("-ascii", "something.asc")
>
> An example in the documentation for "load" (and "save",
> ...) would be helpful. Where is the command <--> function
> relationship documented?
>
>
>
>
-------------------------------------------------------------
> 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
>
-------------------------------------------------------------
>
-------------------------------------------------------------
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
-------------------------------------------------------------