[major] struct array indexing in tip

Nicholas Tung ntung at ntung.com
Sun Jan 18 20:45:29 CST 2009


in revision
hg tip
changeset:   8534:0eb83938c8bc

struct indexing is messed up. The following code should simply add to the
value of c at 2, but creates some weird cell array...
octave:1> a.c = [1, 2, 3]
a =
{
  c =
     1   2   3
}
octave:2> e = [a, a]
e =
{
  1x2 struct array containing the fields:
    c
}
octave:3> e(1).c(2)
ans =  2
octave:4> e(1).c(2) += 1
e =
{
  1x2 struct array containing the fields:
    c
}
octave:5> e.c
ans =
{
  [1,1] =
     1   2   3
  [1,2] =  3
}
ans =
   1   2   3

Thanks in advance; please tell me when it's fixed.

cheers,
Nicholas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090118/d7a4bafd/attachment.html 


More information about the Bug-octave mailing list