help-octave
[Top][All Lists]
Advanced

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

Save of lists and structs


From: Dr. Michael Martins
Subject: Save of lists and structs
Date: Thu, 11 Nov 2004 05:18:30 -0600
User-agent: KMail/1.6.2

Hello,

I have a problem saving a complex list with octave. Below is a function 
ldddat, which reads experimental data and stores it into a struct; attached 
is a small part of a data file.

To store data from different files I use the command 
'd(no) = lddat(datafilename)'
creating a list d, which contains the data from different measurements and are 
indexed with no. Up to here everything works perfect. However, I would like 
to store the complete list d with additional informations. Therefore I use

save -mat-binary daten.mat d

Unfortunately I am not able to read the data again!

This is, what is written into the file
---------------
{
  B =

  (,
    [1] = [](0x0)
    [2] = [](0x0)
    [3] = [](0x0)
    [4] = [](0x0)
    [5] = 0
  ,)

  dat =

  (,
    [1] = [](0x0)
    [2] = [](0x0)
    [3] = [](0x0)
    [4] = [](0x0)
    [5] =
        7.6300e+02    2.0714e-09    1.0140e-10    9.1753e+01    3.9435e-10 
8.4074e+00    2.2094e+01   -1.0245e+01    7.6302e+02
more is coming
--------------------

But unfortunately I am getting back the following
----------------------------------------
{
  B =

  (,
    [1] = [](0x0)
    [2] = [](0x0)
    [3] = -1
    [4] = [](0x0)
    [5] = [](0x0)
  ,)

  dat =

  (,
    [1] = [](0x0)
    [2] = [](0x0)
    [3] = [](0x0)
    [4] = [](0x0)
    [5] =

      763.00
more is coming
-----------------------------------------

Thus, there is either a problem in writing the data or reading it back. I 
would be really nice, if this problem could be solved. I am using octave 
2.1.57 on a linux system.


## Function to read the data
function y=lddat(nam)
  d = load(nam);
  y.x = d(:,1);
  y.dat = d;
  y.y = d(:,3) ./ d(:,5);
  y.shift = d(:,8);
  y.pol = y.shift(1)/abs(y.shift(1));
  y.B = 0.0;
  y.sample = "";
end
## end

Regards
        Michael

-- 
|\  /| Dr. Michael Martins, Universitaet Hamburg
| \/ | Institut fuer Experimentalphysik    Tel.: +49-40-8998-3121
| |\/| Luruper Chaussee 149,   
| |  | D-22761 Hamburg         Email: address@hidden

Attachment: icetm013.999
Description: Text document

Attachment: lddat.m
Description: Text Data


reply via email to

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