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