help-octave
[Top][All Lists]
Advanced

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

save;load question


From: D Goel
Subject: save;load question
Date: Fri, 17 Dec 2004 15:14:40 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux)


hi

If a file contains merely data, no variable information, octave
handily allows one to load that data into a variable of choice: 

var=load("file")

Very convenient.   But somehow, one can't save this way: 



Suppose program 1 generates a matrix, M, and needs to store it in a
file for later access by some other program: 

save("file","M").


Program 2 does not know what program 1 calls the matrix, so it tries
the above loading trick: 

var=load("file").

But this time, var is not the matrix any more.  It is now a structure.
This is because when saving, octave added the variable name "M" in
comments.  If there were no comments, this would work, but here it
doesn't.


So, how do i extract the actual value of the matrix inside the program
from this structure?  (Note that the program does not know that the
name of the variable is M).



Even better, is there a way to ask octave to save a variable, but
without the comments which store the variable-name as well?



Thanks very much. 




 DG                                 http://gnufans.net/
 --



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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