Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Matrix manipulation Question - arranging rows

조회 수: 1 (최근 30일)
Mohammad Mahmoud
Mohammad Mahmoud 2019년 11월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
For example i have the following matrix
a = 1 y y y
4 x x x
2 z z z
3 h h h
where the letters are random numbers
how can i re-arrange the rows depending on the value on the first colomn from lowest to highest so the matrix becomes like this
a = 1 y y y
2 z z z
3 h h h
4 x x x
Thank you

답변 (1개)

the cyclist
the cyclist 2019년 11월 16일
편집: the cyclist 2019년 11월 16일
sortrows(a,1)
See the documentation for sortrows for details.

Community Treasure Hunt

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

Start Hunting!

Translated by