Use the sortrows() function.
Sorting along column
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a matrix
a =
-5 30 120
-10 15 240
after sort(a) I am getting
-10 30 120
-5 15 240
But how can i get column 2 and column to align accordingly, means i need the output as
-10 15 240
-5 30 120
How can i get this ?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!