octave-maintainers
[Top][All Lists]
Advanced

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

Re: Subtle nested structure assignment behavior


From: Daniel J Sebald
Subject: Re: Subtle nested structure assignment behavior
Date: Wed, 24 Dec 2008 10:08:37 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

John W. Eaton wrote:
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?

The version I used to generate those error messages was 3.0.0+.  However, I'm 
seeing very similar messages with the latest HG version on a different machine. 
 There seems to be one of these errors:

error: matrix cannot be indexed with .
error: scalar cannot be indexed with .
error: invalid vector index = 2

but I can't figure out repeatable conditions where one happens versus the other.

Dan


reply via email to

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