help-octave
[Top][All Lists]
Advanced

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

Re: struct weirdness


From: Jordi Gutiérrez Hermoso
Subject: Re: struct weirdness
Date: Thu, 23 Aug 2012 16:58:02 -0400

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.


reply via email to

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