Indexing where all entries are false

Richard Bovey Richard.Bovey at baesystems.com
Tue May 13 03:39:50 CDT 2008


The result of indexing a vector with logicals has changed from 3.0.0 to
3.0.1. I believe that the 3.0.1 behaviour maybe considered incorrect as it
is inconsistent with Matlab, while 3.0.0 was consistent with Matlab.

In 3.0.1 if all the entries in the index are false a matrix with size 0x0 is
returned, while 3.0.1 returns 1x0 or 0x1 depending on the shape of the input
vector.

I'm using Windows XP.

Below are some example sessions in 3.0.1 and 3.0.0.

------------------

>> OCTAVE_VERSION
ans = 3.0.1
>> x = [1 1 1]
x =

   1   1   1

>> x([false false false])
ans = [](0x0)

------------------

>> OCTAVE_VERSION
ans = 3.0.0
>> x = [1 1 1]
x =

   1   1   1

>> x([false false false])
ans = [](1x0)

Regards,
Richard
-- 
View this message in context: http://www.nabble.com/Indexing-where-all-entries-are-false-tp17203768p17203768.html
Sent from the Octave - Bugs mailing list archive at Nabble.com.



More information about the Bug-octave mailing list