Compute an orthogonal symmetric matrix in MATLAB

282 Views Asked by At

So, I have just finished implementing the practical QR algorithm for finding eigenvalues of a symmetric real-valued matrix and it seems to work great! I am currently testing my function and was thinking about testing it for symmetric orthogonal matrices. How can I construct such a matrix in MATLAB? I was able to construct a random symmetric matrix by using A = randn(10,10); symmetric = (A + A')/2 .

1

There are 1 best solutions below

0
On BEST ANSWER

Consider the matrix,

$$A=I-2vv^T$$

where $v$ is a unit vector which is clearly symmetrical.

$$A^TA=(I-2vv^T)(I-2vv^T)=I-4vv^T+4vv^Tvv^T=I$$

This is known as Householder reflection.