octave-maintainers
[Top][All Lists]
Advanced

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

Re: struct arrays and cs-lists


From: Olaf Till
Subject: Re: struct arrays and cs-lists
Date: Tue, 13 Nov 2012 19:13:21 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Nov 13, 2012 at 12:54:09PM -0500, Jordi Gutiérrez Hermoso wrote:
> On 13 November 2012 12:40, Olaf Till <address@hidden> wrote:
> > On Tue, Nov 13, 2012 at 09:42:54AM -0500, Jordi Gutiérrez Hermoso wrote:
> >> ...
> >> The point is that I think struct arrays are best interpreted as cell
> >> arrays where one dimension is indexed with strings instead of
> >> positive integers. Indeed, the struct2cell and cell2struct functions
> >> perform the conversion this way, by changing the way that one
> >> dimension is indexed, whether with strings or positive integers. The
> >> problem is that there seems to be no way to index struct arrays along
> >> their string dimension
> >
> > If I understand you right --- there is a way, in the struct package:
> > fields2cell works as struct2cell but you can specify (a) field(s). But
> > you have to permute() the result if you want the original dimensions
> > with only one field. If you think its worth I could add a compiled
> > function for only one field which preserves the original dimensions.
> 
> This sounds nice, but is this really how things would need to be? Are
> the cs-lists you get from s.foo just a weird wart in the language?

IMHO its vain to discuss this, as Octave adhers to Matlab language. So
using a function for this is probably the only way.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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