From e266b8396c8e7f992dd77ebec3f8d60186c09599 Mon Sep 17 00:00:00 2001 From: Erik R Eaton Date: Tue, 28 Mar 2017 23:40:13 -0400 Subject: [PATCH] delete, original version --- lu_tridiag.m | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 lu_tridiag.m diff --git a/lu_tridiag.m b/lu_tridiag.m deleted file mode 100644 index 5a8c4c0..0000000 --- a/lu_tridiag.m +++ /dev/null @@ -1,26 +0,0 @@ -%e, f, and j should all be vectors -%A matrix must be square in order to run LU decomposition -%This function will output: - %diagonal of upper matrix - %off diagonal of upper matrix - %off diagonal of lower matrix -function [ud,uo,lo]=lu_tridiag(e,f,g); -ud = zeros(length(f), 1); -uo = zeros(length(f)-1, 1); -lo = zeros(length(f)-1, 1); - -lo = g; %off diagonal of lower matrix=off diagnol vectors -ud(1)=f(1); %location one of upper diagonal= dignol vector at location -uo(1) = g(1); %location one of upper matrix = off diagnol vector -k = 2; %Starts off the while loop - -while k <= length(f)-1 - lo(k-1) = e(k-1)/(ud(k-1)); - uo(k) = g(k); - ud(k) = f(k)-(lo(k-1)*uo(k-1)); - k = k + 1; -end -lo(k-1) = e(k-1)/(ud(k-1)); %Need these two equations otherwise the last value wont work - ud(k) = f(k)-(lo(k-1)*uo(k-1)); - -