AAE-NA-Labs/Direct Methods for Solving Linear Systems/main.m

11 lines
215 B
Mathematica
Raw Normal View History

clear all;
2021-03-06 18:17:36 +01:00
B = [2, -1, 0, 0; -1, 2, -1, 0;0, -1, 2, -1; 0, 0, -1, 2];
2021-03-06 18:17:36 +01:00
b = [0;0;0;5];
2021-03-06 18:17:36 +01:00
[U, Mk] = outer_product_gaussian_elimination(B);
back_substitution(U, b);
A = gaussian_elimination_with_complete_pivoting(B);