Incorrect output of sortrows function
Mostrar comentarios más antiguos
Hi everyone,
Sortrows function seems to return incorrect arranged array, here is very specfice example.
A = [110.359026830732,-23.6025085449219,2.30662154653535; ...
110.359026830732,-23.6025085449219,2.93833414713542; ...
110.359026830732,-23.6025085449219,2.30662154653535]
In array A, the first and last point is the same and should be returned in position 1 and 2. But point 3 will be returned in position 3. However, output is not correct as below:
B = sortrows(A,[1 2],{'ascend','ascend'})
>> B =
110.3590 -23.6025 2.3066
110.3590 -23.6025 2.9383
110.3590 -23.6025 2.3066
Checking if the rows 1 and 3 are same:
A(1,:) == A(3,:)
ans =
1×3 logical array
1 1 1
Is it because I am using the double array format? any help will be appreciated.
Thank you
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!