AAE-NA-Labs/01_Direct-Methods-for-Solving-Linear-Systems/Report/problems/Problem8.m

32 lines
461 B
Mathematica
Raw Permalink Normal View History

2023-03-11 20:08:05 +01:00
A = [ 1 -1 0 0;
-1 2 -1 0;
0 -1 2 -1;
0 0 -1 2];
if all(eig(A) > 0)
C = Alg10(A)
C*C.' - A
inv(C)
end
C =
1 0 0 0
-1 1 0 0
0 -1 1 0
0 0 -1 1
ans =
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
ans =
1 0 0 0
1 1 0 0
1 1 1 0
1 1 1 1