octave-maintainers
[Top][All Lists]
Advanced

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

Subtle nested structure assignment behavior


From: John W. Eaton
Subject: Subtle nested structure assignment behavior
Date: Wed, 24 Dec 2008 10:56:35 -0500

On 24-Dec-2008, Daniel J Sebald wrote:

| Octave doesn't allow assigning a value to a structure array element
| if the levels get too deep.  Is this a bug?  For example:
| 
| octave:11> sroot(1).one.two.three = 55
| sroot =
| {
|   one =
|   {
|     two =
|     {
|       three: 1x1 scalar
|     }
| 
|   }
| 
| }
| 
| octave:12> sroot(2).one.two.three = 66
| error: invalid vector index = 2
| error: evaluating assignment expression near line 12, column 24

Using a copy of Octave built from the current sources, I see

  octave:1>   x(1).a.b.c = 1;
  octave:2>   x(2).a.b.c = 2;
  error: matrix cannot be indexed with .

which also does not look right, but is not the same error as you
show.  So what version of Octave are you using?

jwe


reply via email to

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