Linear Algebra and the C Language/a0of


b1r1 + b2r2 + b3r3 = Ide (The b_r_ are projectors.)

Copy/Paste into the octave window
% A property of spectral decomposition:
%
%        V1 V1' + V2 V2' + V3 V3' = Ide
%        b1 r1  + b2 r2  + b3 r3  = Ide
%
% V (b) : The columns of the eigenvectors of A
% V'(r) : The rows of the eigenvectors of the inverse of A
%         (Here the transpose: see the first example)
%
% V1V1' (b1r1) is obtained by multiplying the first column of the eigenvector
%              of A by the first row of the eigenvector of the inverse of A


clear, clc

A = round(10*randn(3));    %% A matrix 3x3
A = A'*A                   %% A symetric matrix

% Eigenvectors, Eigenvalues
[Evectors,Evalues] = eigs(A);

V1 = Evectors(:,1);
V2 = Evectors(:,2);
V3 = Evectors(:,3);

b1r1 = V1*V1';
b2r2 = V2*V2';
b3r3 = V3*V3';

Ide = b1r1+b2r2+b3r3

%%