help-octave
[Top][All Lists]
Advanced

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

FW: save structs, lists


From: A. Scottedward Hodel
Subject: FW: save structs, lists
Date: Wed, 13 Jan 1999 15:59:21 -0600

John (and Octave users),

Do you have any near term plans to store/load structures and lists
from data files?  I'm trying to decide whether to write functions
such as 
    dat2vec, vec2dat
that would allow storage of structures and lists in save statements, e.g.
myvec = dat2vec(mylist);
save myvec;

...

load myvec
mylist = vec2dat(myvec);
(Obviously, these functions must be able to operate recursively.)
Such scripts would bypass the problem below:

octave:1> mystruct.real = 1;  mystruct.imag = 1;
octave:2> mylist = list(1,2,"joe",mystruct)
mylist =
(
  [1] = 1
  [2] = 2
  [3] = joe
  [4] =
  {
    real = 1
    imag = 1
  }
)
octave:3> save mylist
warning: save: wrong type argument `struct'
warning: save: wrong type argument `list'
octave:4> exit
edalf:/S4/hodel $ more mylist*
# Created by Octave 2.1.10, Wed Jan 13 21:43:14 1999 <address@hidden
ov>
# name: mystruct
# name: mylist

A S Hodel Assoc. Prof. Dept Elect Eng, Auburn Univ,AL  36849-5201
On leave at NASA Marshall Space Flight Center (256) 544-1426
Address:Mail Code ED-13, MSFC, Alabama, 35812
http://www.eng.auburn.edu/~scotte




reply via email to

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