[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making unique() semantics compatible with MATLAB
From: |
Julien Bect |
Subject: |
Re: Making unique() semantics compatible with MATLAB |
Date: |
Wed, 30 Mar 2016 13:53:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 |
Le 30/03/2016 13:31, Ben Abbott a écrit :
The second is that a1 returns the indices of the last match, and
Matlab returns the first.
Recent versions of Matlab return the first index, but older versions (<=
R2012b) returned the last.
Matlab's unique function has a "legacy" flag for users that want the old
behaviour.
Source : http://www.mathworks.com/help/matlab/ref/unique.html
Octave's unique function doesn't have the "legacy" flag, but has "last"
/ "first" flags. The default currently is "last" : perhaps should it be
changed to "first" to match the behaviour of recent versions of Matlab ?
There are related bug reports (perhaps duplicated ?) discussing the
"stable" option of unique :
https://savannah.gnu.org/bugs/?func=detailitem&item_id=38460
https://savannah.gnu.org/bugs/?func=detailitem&item_id=46856
@++
Julien