[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45685] union.m for mixed inputs and when one
From: |
Juan Pablo Carbajal |
Subject: |
[Octave-bug-tracker] [bug #45685] union.m for mixed inputs and when one is empty |
Date: |
Mon, 03 Aug 2015 21:20:27 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?45685>
Summary: union.m for mixed inputs and when one is empty
Project: GNU Octave
Submitted by: juanpi
Submitted on: Mon 03 Aug 2015 09:20:26 PM GMT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: juanpi
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
In matlab
>> union({}, [])
ans =
Empty cell array: 0-by-1
>> union([], {})
ans =
Empty cell array: 0-by-1
union([], {'a', 'b'})
ans =
'a'
'b'
(this is a 2 x 1 cell array containing 'a', and 'b')
>> union(['a', 'b'], {})
ans =
'ab'
(this is a 1 x 1 cell array containing the string 'ab')
This is not the case for Octave
The attached patch fixes this for union, setdiff and setxor.
However
intersect (['a', 'b'], {})
intersect ([], {'a', 'b'})
intersect ([], {})
Return the empty array in Octave but the empty cell array (probably 0x1) in
matlab.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45685>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #45685] union.m for mixed inputs and when one is empty,
Juan Pablo Carbajal <=