From e2a9a9425cc3463414e163b90773aa23ee751af3 Mon Sep 17 00:00:00 2001 From: EdwardEisenhauer Date: Sat, 6 Mar 2021 13:11:29 +0100 Subject: [PATCH] First Commit --- .../outer_product_gaussian_elimination.m | 20 +++++++++++++++++++ README.md | 0 2 files changed, 20 insertions(+) create mode 100644 Direct Methods for Solving Linear Systems/outer_product_gaussian_elimination.m create mode 100644 README.md diff --git a/Direct Methods for Solving Linear Systems/outer_product_gaussian_elimination.m b/Direct Methods for Solving Linear Systems/outer_product_gaussian_elimination.m new file mode 100644 index 0000000..012c1de --- /dev/null +++ b/Direct Methods for Solving Linear Systems/outer_product_gaussian_elimination.m @@ -0,0 +1,20 @@ +% Outer Product Gaussian Elimination (Alg. 3.2.1) +function outer_product_gaussian_elimination(A) + +[n, m] = size(A); +if n ~= m + error('Matrix is not squared!') +end + + if det(A) == 0 + error('Matrix is not nonsingular!') + end + + A + + for k = 1 : n-1 + k + rows = k + 1 : n + A(rows, k) = A(rows, k)/A(k, k) + A(rows, rows) = A(rows, rows) - A(rows, k) * A(k, rows) + end \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29