|
Hm, once again I was faster in replies than proper checking. Although result seems correct on first sight, it isn't
I'll try in my limited English to explain:
-----------------------------------------------------------
% taking small sample x ~ 5 x 10^5
x = <518720x2 double>
% doing suggested:
[T, H]= unique(x, 'rows', 'first');
[H, H] = sort(H);
y = T(H,:);
% output contents of y [<131127x2 double>] in a file:
dlmwrite('y.out', y)
% cut same number of elements as in "y" from "x" sample:
z = [x(1:131127,1) x(1:131127,2)];
dlmwrite('z.out', z)
-----------------------------------------------------------
Now comparing both files:
- there are 11926 differences, or said differently
- 11926 elements are missing inside y.out and appended at y.out end, or said differently
- 11926 elements are inside z.out and missing at z.out end
I hope it's not confusing
Why could this be?
Is this unwanted result from:
[T, H]= unique(x, 'rows', 'first');
or from:
[H, H] = sort(H);
or something else?
Thanks for reading this and for your time
|