Make an existing matrix symmetric

87 visualizzazioni (ultimi 30 giorni)
N/A
N/A il 28 Ott 2016
Commentato: Walter Roberson il 28 Ott 2016
Hi there,
I've have a function where I take a matrix M as an input and return a value based on if it's symmetric or not. I would like to extend this function by altering the input matrix to make it symmetric. How can I make an asymmetric matrix symmetric by altering it?
Thank you

Risposte (1)

Walter Roberson
Walter Roberson il 28 Ott 2016
(M + M.')/2
This is a useful technical when you have values that are intended to be symmetric but which turn out not to be due to round-off error.
  2 Commenti
N/A
N/A il 28 Ott 2016
Thank you. As a solution, what I have done is M + M^T which is always symmetric.
Walter Roberson
Walter Roberson il 28 Ott 2016
Consider that M+M.' will turn the identity matrix into a matrix that has 2 along the main diagonal. It will be symmetric, yes, but you are also changing the values of matrices that start out symmetric.

Accedi per commentare.

Categorie

Scopri di più su Operating on Diagonal Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by