필터 지우기
필터 지우기

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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by