From bug-request at octave dot org Tue Jun 14 13:19:44 2005 Subject: Re: x(:,:,1) allowed for 2D matrix but x(:,;,end) not From: "John W. Eaton" To: David dot Bateman at motorola dot com Cc: Keith Goodman , bug@octave.org Date: Tue, 14 Jun 2005 14:17:03 -0400 On 8-Jun-2005, David Bateman wrote: | Keith Goodman wrote: | | >>>x = rand(3,5); | >>>x(:,:,end) | >>> | >>> | >error: invalid use of end: (index 3, dims 3x5) | >error: evaluating argument list element number 3 | > | > | >>>x(:,:,1) | >>> | >>> | >ans = | > | > 0.545196 0.293759 0.702723 0.245060 0.551427 | > 0.709630 0.792771 0.300131 0.528911 0.409095 | > 0.481650 0.682950 0.601069 0.040483 0.581705 | > | > | > | > | >But 1 is equal to end. I'm using 2.9.3. | > | > | > | > | Try the following patch | | D. | | 2005-05-30 David Bateman | | * pt-arg-list.cc (F__end__): Allow end keyword for dimensions | larger than ndim, and return 1. I made this change, but without the cast since it should not be needed here. 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 -------------------------------------------------------------