bugGNU Octave - Bugs: bug #31764, logical indexing regression 3.0.1...


bug #31764: logical indexing regression 3.0.1 vs 3.2.4 (also dev) - differs from Matlab

Submitted by:  jkirby <jkirby>
Submitted on:  Fri 03 Dec 2010 01:53:24 AM UTC  
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Duplicate Assigned to:  None
Originator Name:  jkirby Open/Closed:  Closed
Release:  3.2.4 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 10 Dec 2010 04:43:49 PM UTC, comment #2: 

This looks like a duplicate of https://savannah.gnu.org/bugs/index.php?31287, so I'm closing this report.

John W. Eaton <jwe>
Project Administrator
Thu 09 Dec 2010 05:53:05 PM UTC, comment #1: 

Confirmed on a recent tip (11329:6b073da9d7fc).

The second sequence of commands is the simplest way to expose that something is different.

a = 1;
a(1, false) = [];

Rik <rik5>
Project Administrator
Fri 03 Dec 2010 01:53:24 AM UTC, original submission:  

this script correctly returns geo = 0.62970 in 3.0.1 and Matlab 2010a but "error: A(I,J,...) = X: dimensions mismatch" in 3.2.4 and 3.3.54+

geo = [0.6297]
c2 = [0.6562]

ic2 = (c2 < 0.3)
c = [0.8082]
geo (1,ic2) = acos(c(ic2))

this is on a windows build in all three cases.

Also (reported from: http://octave.1599824.n4.nabble.com/logical-indexing-regression-3-0-1-vs-3-2-4-td3067780.html)

Yes, in a GNU/Linux build in 3.2.4 and current tip. In current tip
(your script reduces to the first two lines):

octave:1> a = 1;
octave:2> a(1, false) = acos ([])
error: A(I,J,...) = X: dimensions mismatch
octave:2> a(1, false) = zeros (0, 0)
error: A(I,J,...) = X: dimensions mismatch

but weirdly:

octave:2> a(1, false) = []
error: A null assignment can only have one non-colon index.
octave:2> a(1, false) = zeros (1, 0)
a =  1
octave:3> a(1, false) = zeros (0, 1)
a =  1
octave:4> a(1, false)
ans = [](1x0)

jkirby <jkirby>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jkirby (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-10 jwe StatusNone => Duplicate
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.7