How to sort/Rearrange a matrix

4 ビュー (過去 30 日間)
Zahid Iqbal Rana
Zahid Iqbal Rana 2014 年 12 月 22 日
コメント済み: Star Strider 2014 年 12 月 23 日
I want to sort a matrix in such a way so that in 1st column all values in ascending order but in other columns all values should be the same. Elements of one row can't change their respective row.
if I have a=[1 2 3 0;4 7 8 9;5 2 3 4;2 7 5 6] then output should be =
[1 2 3 0;2 7 5 6;4 7 8 9;5 2 3 4]

採用された回答

Star Strider
Star Strider 2014 年 12 月 22 日
The sortrows function will do what you want.
  4 件のコメント
Zahid Iqbal Rana
Zahid Iqbal Rana 2014 年 12 月 23 日
Thank you so much
Star Strider
Star Strider 2014 年 12 月 23 日
My pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by