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

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

 Accepted Answer

b=triu(a)+triu(a,1).'; %the result

2 Comments

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 ?
.' means transpose
Without the dot, it is conjugate tranpose
As long as your matrices are real-valued, they should give the same result.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2020a

Asked:

on 17 Jul 2020

Edited:

on 19 Jul 2020

Community Treasure Hunt

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

Start Hunting!