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

 Submitted by: 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

You are not logged in

## Discussion

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>
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>
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.

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)
octave:5>

jkirby <jkirby>

## Attached Files

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

Attach Files:

Comment:

No files currently attached

## Dependencies

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?
This task has 0 encouragements so far.

Only project members can vote.