How to sort one column of a matrix

33 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 8 月 13 日
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
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 8 月 13 日
Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by