Linear Algebra and the C Language/a0ny


A = EVector EValue EVectorT

Copy/Paste into the octave window
% Matrix 2x2 -------------

clear, clc

A = round(15*randn(2));    %% A matrix 2x2
A = A'*A                   %% A symetric matrix

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

A = Evectors * Evalues * Evectors'
%%


B = EVector EValue EVectorT

Copy/Paste into the octave window
% Matrix 3x3 ---------------------

clear, clc

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

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

B = Evectors * Evalues * Evectors'
%%