help-octave
[Top][All Lists]
Advanced

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

Re: struct weirdness


From: Sergei Steshenko
Subject: Re: struct weirdness
Date: Thu, 23 Aug 2012 14:06:50 -0700 (PDT)


--- On Thu, 8/23/12, Jordi Gutiérrez Hermoso <address@hidden> wrote:

> From: Jordi Gutiérrez Hermoso <address@hidden>
> Subject: Re: struct weirdness
> To: "Przemek Klosowski" <address@hidden>
> Cc: "address@hidden" <address@hidden>
> Date: Thursday, August 23, 2012, 1:58 PM
> On 23 August 2012 10:46, Przemek
> Klosowski <address@hidden>
> wrote:
> > I was looking at the example from http://wiki.octave.org/Cookbook:
> >
> > samples = struct ("patient", {"Bob", "Kevin", "Bob" ,
> "Andrew"},
> >               
>     "age",     [ 45 
> ,  52    ,  45   , 
> 23     ],
> >               
>     "protein", {"H2B", "CDK2" , "CDK2", "Tip60"
> },
> >               
>     "tube"   , [
> 3   ,  5     , 
> 2    ,  18     ]
> >               
>     );
> 
> This the square brackets should be curly. Then it's a struct
> array,
> and if you do samples(1) and samples(2), you get the data
> you expect.
> Can you update the wiki?
> 
> I find it difficult to think in terms of cell arrays. They
> are
> basically multidimensional cell arrays, which are already
> weird in
> themselves since indexing them with {} gives cs-lists,
> except the one
> dimension is indexed strings instead of positive integers.
> 
> - Jordi G. H.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
> 

"This the square brackets should be curly" - if it's a must, and square 
brackets are accepted, then we have a bug - because no error message is issued.

If square brackets are allowed, then the struct element should be treated as 
vector in this case, which it is not - see my earlier Email in the thread. So, 
I think, we still have a bug - because square brackets are not treated as they 
normally do.

Regards,
  Sergei.


reply via email to

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