AAE-NA-Labs/01_Direct-Methods-for-Solving-Linear-Systems/Report/problems/Problem2.m
Sergiusz Warga a3fa9eb91d refac
2023-03-11 20:08:05 +01:00

15 lines
228 B
Matlab

A = [1, 1, 1;
1, 1, 2;
1, 2, 2];
b = [1;2;1];
[P, Q, L, U] = Alg2(A);
% PAQ = LU
% Ly = b and Ux = y
y = Alg3(L, P*b); % Forward substitution
x = Q*Alg4(U, y) % Backward substitution
x =
1
-1
1