フィルターのクリア

sort from largest to smallest

129 ビュー (過去 30 日間)
Quynh tran
Quynh tran 2017 年 5 月 19 日
コメント済み: Steven Lord 2019 年 8 月 12 日
Dear all, I have this matrix:
A=[1 3
3 6
4 7
5 8
6 2
8 3
9 6]
Could you help me how to arrange the first colum from max to min

採用された回答

James Tursa
James Tursa 2017 年 5 月 19 日
編集済み: James Tursa 2017 年 5 月 19 日
sort(A(:,1),'descend')
If you want to sort the matrix A by rows based on the first column, then e.g.
flipud(sortrows(A))
Or variations of the above based on what you want for output.
  3 件のコメント
antlhem
antlhem 2019 年 8 月 7 日
Hi, wat's the oposite of flipud? I want to sort the whole rows in ascedent way
Steven Lord
Steven Lord 2019 年 8 月 12 日
flipud is the opposite of flipud, but that's not the solution you're looking for. Either calling sort with 'ascend' instead of 'descend' or omitting that option entirely (since 'ascend' is the default direction) are the solutions you're looking for.

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

その他の回答 (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