# Compute an orthogonal symmetric matrix in MATLAB

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 .

$$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$$