Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a0oa

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ The sum of the eigenvalues ​​of A is equal to the trace of A: Copy/Paste into the octave window % The sum of the eigenvalues ​​of A is equal to the trace 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 ("Add up all the eigenvalues: sum(Evalues)\n\n") SEvalues = sum (Evalues) printf ("\nCompute the trace: trace(A)\n\n") traceA = trace(A) %% Screen output example: A = 658 111 -53 221 111 113 -16 -4 -53 -16 86 116 221 -4 116 330 Evalues = 783.4492 309.8050 87.2533 6.4926 Add up all the eigenvalues: sum(Evalues) SEvalues = 1187.0 Compute the trace: trace(A) traceA = 1187 >>