Is there a simple way to rearrange a matrix into a diagonally dominant form?

16 views (last 30 days)
I have a matrix and I need to make sure that it is diagonally dominant, I need to do this by ONLY pivoting rows.
I can find codes to test for dominance in that they will check to make sure that the value in the diagonal is greater than the sum of the row, but I cant find anything on how make matlab recognize that it needs to pivot if the diagonal is not greater than the sum of the row

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 24 Jan 2013
Edited: Azzi Abdelmalek on 24 Jan 2013
If I've understood your question
a=[1 2 3;4 5 6;7 8 9]
diag_som=trace(a)
mat_som=sum(a,2)
test=any(mat_som>diag_som) % If test=1 then a is diagonally dominant

Retta Moges Ashagrie
Retta Moges Ashagrie on 19 Sep 2018
diag_som=trace(a) mat_som=sum(a,2)-diag(a) test=any(mat_som>=diag_som)

Categories

Find more on Operating on Diagonal Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!