how can ı sort of the matrices
1 次查看(过去 30 天)
显示 更早的评论
ı want to sort to this matrice like this but ı dont know how can ı do that? help me pls.
4 个评论
Image Analyst
2018-7-7
Do you have the Statistic and Machine Learning Toolbox? Did you use knnsearch()? See attached demo.
采纳的回答
Image Analyst
2018-7-8
Transpose distance so that it has 2 columns. Then call sortrows().
sortedDistances = sortrows(distance', 1);
3 个评论
Image Analyst
2018-7-8
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!