how can ı sort of the matrices
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
mts
el 7 de Jul. de 2018
Comentada: mts
el 8 de Jul. de 2018
ı want to sort to this matrice like this but ı dont know how can ı do that? help me pls.
4 comentarios
Image Analyst
el 7 de Jul. de 2018
Do you have the Statistic and Machine Learning Toolbox? Did you use knnsearch()? See attached demo.
Respuesta aceptada
Image Analyst
el 8 de Jul. de 2018
Transpose distance so that it has 2 columns. Then call sortrows().
sortedDistances = sortrows(distance', 1);
3 comentarios
Image Analyst
el 8 de Jul. de 2018
sortrows moves rows together, all columns in lock-step. That's what we want. We do not want to sort the original first row, and then the second row. However the first row gets repositioned, we want the second row to follow along in the very same order. sortrows() takes care of that for you but the data has to be in rows.
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!