フィルターのクリア

How to order matrix rows?

2 ビュー (過去 30 日間)
Mr M.
Mr M. 2015 年 4 月 17 日
回答済み: Star Strider 2015 年 4 月 17 日
I have a matrix something like this
1 1 ...
2 1 ...
3 1 ...
1 2 ...
2 2 ...
3 2 ...
1 3 ...
2 3 ...
3 3 ...
I would like to arrange rows according to the first column, but I would like to hold the order for equal values, so I would like the following output
1 1 ...
1 2 ...
1 3 ...
2 1 ...
2 2 ...
2 3 ...
3 1 ...
3 2 ...
3 3 ...

採用された回答

Star Strider
Star Strider 2015 年 4 月 17 日
Use the sortrows function, specifying column #1.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by