[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #40808] setxor function produces incorrect res
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #40808] setxor function produces incorrect result with 'row' argument |
Date: |
Wed, 04 Dec 2013 17:16:03 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0 |
URL:
<http://savannah.gnu.org/bugs/?40808>
Summary: setxor function produces incorrect result with 'row'
argument
Project: GNU Octave
Submitted by: None
Submitted on: Wed 04 Dec 2013 05:16:02 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: David Szepesvari
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.4
Operating System: GNU/Linux
_______________________________________________________
Details:
E1 = [1 2; 4 5; 1 3]
E2 = [1 1; 1 2; 4 5]
setxor(E1, E2, 'rows')
produces:
1 1
1 2
1 2
1 3
4 5
4 5
when what I expect (and is outputted by Matlab):
1 1
1 3
or
1 3
1 1
I attached the fixed setxor.m file. It is only line 64 (in the attached
file),
idx = find (all (c(1:n-1) == c(2:n), 2));
that is changed to
idx = find (all (c(1:n-1, :) == c(2:n, :), 2));
Unrelated:
Why is the number of rows of a and b counted, if these are not used. Also, the
rows of c are saved into n, end then 'n-1' is used for indexing; is there a
particular reason for not using 'end-1'?
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Wed 04 Dec 2013 05:16:02 PM UTC Name: setxor.m Size: 3kB By: None
<http://savannah.gnu.org/bugs/download.php?file_id=29787>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40808>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #40808] setxor function produces incorrect result with 'row' argument,
anonymous <=