Matrix Indexing with respect to sum of matrix raws

1 Ansicht (letzte 30 Tage)
Usman Taya
Usman Taya am 20 Jun. 2019
Kommentiert: Rena Berman am 8 Jul. 2019
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 Kommentare
madhan ravi
madhan ravi am 20 Jun. 2019
No!!!! Don’t edit the question after someone has answered the question!
Rena Berman
Rena Berman am 8 Jul. 2019
(Answers Dev) Restored edit

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

madhan ravi
madhan ravi am 20 Jun. 2019
Bearbeitet: madhan ravi am 20 Jun. 2019
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 Kommentare
madhan ravi
madhan ravi am 20 Jun. 2019
Bearbeitet: madhan ravi am 20 Jun. 2019
No it’s your homework not mine sorry.
doc sum
doc sort
Usman Taya
Usman Taya am 20 Jun. 2019
Thanks.
I have done it

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by