Matrix Indexing with respect to sum of matrix raws
1 回表示 (過去 30 日間)
古いコメントを表示
A =
-9 3 -1 9
-4 0 1 -2
-2 5 6 -9
I want to sort it and want to get following result after sort matrix A kindly let me know how i can get following results:
A =
-4 0 1 -2
-2 5 6 -9
-9 3 -1 9
Here matrix A is sort based of sum of each row.
2 件のコメント
採用された回答
madhan ravi
2019 年 6 月 20 日
編集済み: madhan ravi
2019 年 6 月 20 日
1) Sum A with respect to rows.
2) Use sort() for sum of rows and collect the second output of it.
3) Use the second output of sort() as the row indices of A.
3 件のコメント
madhan ravi
2019 年 6 月 20 日
編集済み: madhan ravi
2019 年 6 月 20 日
No it’s your homework not mine sorry.
doc sum
doc sort
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!