[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: need help understanding structure arrays
From: |
John W. Eaton |
Subject: |
Re: need help understanding structure arrays |
Date: |
Sat, 20 Oct 2007 01:30:02 -0400 |
On 19-Oct-2007, DushanM wrote:
| Kim Hansen <address@hidden> wrote:
|
| >On 10/19/07, DushanM <address@hidden> wrote:
| >> *** octave-2.9.15:46$
| >> => x(1).a = "string1"
| >> error: in indexed assignment of matrix, last lhs index must be ()
| >> error: assignment failed, or no method for `matrix = string'
| >> error: evaluating assignment expression near line 46, column 8
| >
| > I can not reproduce that problem, try to start a fresh octave and see
| > if you can reproduce it.
| >
| > This is what I got:
| > =======================
| > address@hidden:~$ octave
| > GNU Octave, version 2.9.15
| > [...]
| > octave:1> x(1).a = "string1"
| > x =
| > {
| > a = string1
| > }
| >
| > octave:2>
| =======================
|
| That was a good idea, because when I launched a fresh octave, the
| example worked the same way yours did. Now I'm wondering why the
| different behaviors on my system. Thanks for your help.
If X is already defined as a non-empty matrix, then
x(1).a = "string1"
will fail with the message you saw initially.
jwe