help-octave
[Top][All Lists]
Advanced

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

Re: Data frames ?


From: Przemek Klosowski
Subject: Re: Data frames ?
Date: Mon, 29 Oct 2007 13:07:24 -0500 (EST)

   I recently dived into code I wrote a few months ago ... and had a hard time
   remembering what contained a matrix.

   A possible solution to this kind of annoyance would be to implement something
   similar to R "data frames". Such object is a matrix where lines and columns
   have associated name. This way, matrix would be self-documented. This would
   also help reading data headers, i.e. column names

Did you consider structs? a.vol=[1,2,3];a.pres=[4,6,7];
octave:22> a
a = {
  vol =      1   2   3
 pres =      4   6   7
}

In principle, different data rows would have different units and
would be treated separately in calculations, but if you needed to
combine them into a big matrix, you can do cell2mat(struct2cell(a)):

        1   2   3
        4   6   7



reply via email to

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