Matlab not returning an orthonormal matrix of eigenvectors

When I try to find my own decomposition of a matrix in Matlab that has a repeating eigenvalue but is NOT defective, it does not return an orthonormal matrix of injectors. For example:

k = 5;
repeats = 1;

% First generate a random matrix of eignevectors that is orthonormal
V = orth(rand(k));

% Now generate a vector of eigenvalues with the given number of repeats
D = rand(k,1);
for i = 1:repeats
    % Put one random value into another (note this sometimes will result in
    % less than the given number of repeats if we ever input the same
    % number)
    D(ceil(k*rand())) = D(ceil(k*rand()));
end

A = V'*diag(D)*V;

% Now test the eignevector matrix of A
[V_A, D_A] = eig(A);

disp(V_A*V_A' - eye(k))

I find that my eigenvector matrix is V_Anot orthogonal, i.e. V_A*V_A'not equal to the identity matrix (taking into account rounding errors).

I got the impression that if my matrix were real and symmetrical, then Matlab would return the orthogonal matrix of eigenvectors, so what's the problem?

+4
source share
2 answers

, -, .

. A . eps, .

>> A-A.'
ans =
   1.0e-16 *
         0   -0.2082   -0.2776         0    0.1388
    0.2082         0         0   -0.1388         0
    0.2776         0         0   -0.2776         0
         0    0.1388    0.2776         0   -0.5551
   -0.1388         0         0    0.5551         0

A , V_A, eps:

>> A = (A+A.')/2;
>> A-A.'
ans =
     0     0     0     0     0
     0     0     0     0     0
     0     0     0     0     0
     0     0     0     0     0
     0     0     0     0     0
>> [V_A, D_A] = eig(A);
>> disp(V_A*V_A' - eye(k))
   1.0e-15 *
   -0.3331    0.2220    0.0755    0.1804         0
    0.2220   -0.2220    0.0572   -0.1665    0.1110
    0.0755    0.0572   -0.8882   -0.0590   -0.0763
    0.1804   -0.1665   -0.0590         0   -0.0555
         0    0.1110   -0.0763   -0.0555         0

, , V_A , A , A . , : @ArturoMagidin,

(1) , , . , , .

(2) , , , .

Matlab, , (2) ( , V_A ), A . A , , (1) , .

+10

, AA '= A'A . , MATLAB . AA '~ = A'A. , .

0

Source: https://habr.com/ru/post/1612577/


All Articles