unique and lex_sort give different results
@mottelet)
Reported by Stéphane MOTTELET (The indices returned by unique are wrong (k1 and k2 below should be the same). This bug can break many things, as lex_sort is said to be obsolete in the help page !
m=[1. 1.
1. 1.
1. 1.
1. 30.
1. 125.
1. 199.
2. 2.
2. 2.
2. 2.
2. 31. ];
[N1,k1]=unique(M1_m(1:10,1:2),'r')
[N2,k2]=lex_sort(M1_m(1:10,1:2),'unique')
k1 =
2.
4.
5.
6.
8.
10.
N1 =
1. 1.
1. 30.
1. 125.
1. 199.
2. 2.
2. 31.
k2 =
1.
4.
5.
6.
7.
10.
N2 =
1. 1.
1. 30.
1. 125.
1. 199.
2. 2.
2. 31.