sorting matrix by diagonal of submatrix
이전 댓글 표시
Hi,
I have a matrix of m x m^2 and I want to find the diagonals of the sub matrices m x m, then rearrange the matrix A such that the sub matrix with the largest diagonal is first and the sub matrix with the lowest diagonal is last
E.g. For the matrix A = [A1 A2 A3]
A =
2 4 6 8 9 1 4 8 1
4 1 2 3 6 1 2 3 4
5 2 3 4 1 7 2 3 12
Sub matrix A1 has a diagnoal of 6 Sub matrix A2 has a diagonal of 21 Sub matrix A3 has a diagonal of 19
so the final output would be A = [A2 A3 A1]
A =
8 9 1 4 8 1 2 4 6
3 6 1 2 3 4 4 1 2
4 1 7 2 3 12 5 2 3
Thanks in advance
댓글 수: 1
Cedric
2014년 6월 29일
By largest diagonal you mean largest trace?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!