help-octave
[Top][All Lists]
Advanced

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

Re: need help understanding structure arrays


From: DushanM
Subject: Re: need help understanding structure arrays
Date: Mon, 22 Oct 2007 00:29:39 -0600
User-agent: MacSOUP/2.8.1 (Mac OS X version 10.4.10 (x86))

John W. Eaton <address@hidden> wrote:

> 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.

Thanks for the explanation, John.

It leads to one more question: On my system (Mac OS X), octave does
distinguish case, so 'a' and 'A' can have different values.  But I've
seen examples, such as yours above, in which the case seems to be
switched.  How do I interpret this?

- Dushan


reply via email to

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