From bug-octave-request at bevo dot che dot wisc dot edu Thu Jan 22 13:52:32 2004 Subject: Unidentified subject! From: "John W. Eaton" To: dbateman at crm dot mot dot com (David Bateman) Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 22 Jan 2004 13:51:18 -0600 On 31-Dec-2003, David Bateman wrote: | To: bug-octave at bevo dot che dot wisc dot edu | Cc: | Subject: [50 character or so descriptive subject here (for reference)] | | Bug report for Octave 2.1.52 configured for i686-pc-linux-gnu | | Description: | ----------- | | Cell arrays with more than 2 dimensions are completely wrong. | | Repeat-By: | --------- | | b{1,1,1}=1; | b{1,1,2}=2; | b{1,2,1}=3; | b{1,2,2}=4; | b{2,1,1}=5; | b{2,1,2}=6; | b{2,2,1}=7; | b{2,2,2}=8; | | b{:,:,1} | ans = | | (, | [1] = 1 | [2] = 5 | [3] = [](0x0) | [4] = 7 | ,) | | b{:,:,2} | ans = | | (, | [1] = [](0x0) | [2] = 6 | [3] = [](0x0) | [4] = 8 | ,) This should be fixed in CVS now. Here is what I see with the current sources: octave:1> b{1,1,1}=1; octave:2> b{1,1,2}=2; octave:3> b{1,2,1}=3; octave:4> b{1,2,2}=4; octave:5> b{2,1,1}=5; octave:6> b{2,1,2}=6; octave:7> b{2,2,1}=7; octave:8> b{2,2,2}=8; octave:9> b{:,:,1} ans = (, [1] = 1 [2] = 5 [3] = 3 [4] = 7 ,) octave:10> b{:,:,2} ans = (, [1] = 2 [2] = 6 [3] = 4 [4] = 8 ,) | The indexing of b{:,:,1} should be a 2x2 cell array, not a 1x4 cell array. No, it should be a comma-separated list. If you want a cell array, you need to use () for indexing. I think this is consistent with the way Matlab works. Thanks, 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 -------------------------------------------------------------