Info

此问题已关闭。 请重新打开它进行编辑或回答。

Matrix manipulation Question - arranging rows

1 次查看(过去 30 天)
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