[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: An array of arrays?
From: |
John W. Eaton |
Subject: |
Re: An array of arrays? |
Date: |
Wed, 3 Nov 2004 13:18:35 -0500 |
On 3-Nov-2004, Henry F. Mollet <address@hidden> wrote:
| I've tried "a={a{1:2},b,a{3}};" but b replaced element 3. I also tried
| "a={a{1:3},b};" and element 3 was deleted.
| Henry
| octave:18> a{1} = 1;
| octave:19> a{2} = [1,1,1];
| octave:20> a{3} = "string";
| octave:21> a
| a =
| {
| [1,1] = 1
| [1,2] =
| 1 1 1
| [1,3] = string
| }
| octave:23> b="NewString"
| b = NewString
| octave:24> a={a{1:2},b,a{3}};
| octave:25> a
| a =
| {
| [1,1] = 1
| [1,2] =
|
| 1 1 1
|
| [1,3] = NewString
| }
What version of Octave are you using? It works correctly for me with
2.1.57 (and 2.1.60, but 2.1.57 is still the recommended version).
jwe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------