Effacer les filtres
Effacer les filtres

How to reflect the element above the diagonal of a matrix to the lower diagonal ?

6 vues (au cours des 30 derniers jours)
How could I reflect all the upper element of a square matrix of size K = 3 to the lower side
Like this ?
Thank you very much

Réponse acceptée

Matt J
Matt J le 17 Juil 2020
Modifié(e) : Matt J le 17 Juil 2020
b=triu(a)+triu(a,1).'; %the result
  2 commentaires
Tuong Nguyen Minh
Tuong Nguyen Minh le 19 Juil 2020
Why we use triu(a,1).' with the dot instead of triu(a,1)'
When I check it there was not much different, but is this dot usage a prefer engineering practice ?
Matt J
Matt J le 19 Juil 2020
Modifié(e) : Matt J le 19 Juil 2020
.' means transpose
Without the dot, it is conjugate tranpose
As long as your matrices are real-valued, they should give the same result.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by