How to sort one column of a matrix

41 次查看(过去 30 天)
I have a matrix that has 500 rows and 5 columns. I want to sort the matrix based on the 3 rd column. I mean rearrange the matrix based on the 3rd column descending.

采纳的回答

Stephan
Stephan 2019-8-13
编辑:Stephan 2019-8-13
B = sortrows(A,-3)
  3 个评论
Stephan
Stephan 2019-8-13
编辑:Stephan 2019-8-13
note that i used
sortrows
instead of
sort

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by