octave-maintainers
[Top][All Lists]
Advanced

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

Re: displaying structures array as table


From: CdeMills
Subject: Re: displaying structures array as table
Date: Thu, 1 Sep 2011 01:45:49 -0700 (PDT)

forkandwait wrote:
> 
> 
> (Maybe you want something more than display? Honestly displaying
> heterogeneous
> data is the only reason I miss R.)
> 
> Then you could have something like the following:
> 
> a(1).label = 'first';  a(1).x = 1; a(1).y=10;
> a(2).label = 'second'; a(2).x = 2; a(2).y=25;
> 
>> dispt(a)
> 
> label   x  y
> ------------
> first   1 10
> second  2 25
> 

Enclosed in a first try at implementing this.
Prerequise: 
-a structure array with a vector shape
-all fields are numeric
This function is a wrapper around 'disp', so global formating preferences
are used. Field names are used as row/column headers, according to the
structure orientation. Empty values are printed as 'NA', and when the
elements do not all have the same length, the shorter ones are padded with
blanks. Comment, remarks, and ameliorations are welcome.

Regards

Pascal

http://octave.1599824.n4.nabble.com/file/n3783045/tabdisp.m tabdisp.m           
      

--
View this message in context: 
http://octave.1599824.n4.nabble.com/displaying-structures-array-as-table-tp3778402p3783045.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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