411 REFERENCE · Wikibooks
Linear Algebra and the C Language/a0ob
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
__NOTOC__
The product of the eigenvalues of A is equal to the determinant of A:
Copy/Paste into the octave window
% The product of the eigenvalues of A is equal to the determinant of A:
clear, clc
n = 4;
A = round(10*randn(n)); %% A matrix nxn
A = A'*A %% A symetric matrix
% Eigenvalues
Evalues = eigs(A)
printf ("Multiply all the eigenvalues: prod(Evalues)\n\n")
PEvalues = prod (Evalues)
printf ("\nCompute the determinant: det(A)\n\n")
detA = det(A)
%%
Screen output example:
A =
23 93 -5 5
93 421 -111 31
-5 -111 385 93
5 31 93 75
Evalues =
529.1368
333.4511
41.2867
0.1255
Multiply all the eigenvalues: prod(Evalues)
PEvalues = 9.1394e+05
Compute the determinant: det(A)
detA = 9.1394e+05