In the present discussion we assume that our matrix is real and symmetric, that is A∈Rn×n. The matrix A has n eigenvalues λ1…λn (distinct or not). Let D be the diagonal matrix with the eigenvalues on the diagonal D=(λ1000…000λ200…0000λ300…0…………………0…………λn−10…………0λn). If A is real and symmetric then there exists a real orthogonal matrix S such that STAS=diag(λ1,λ2,…,λn), and for j=1:n we have AS(:,j)=λjS(:,j).