This document describes the Doolittle algorithm for matrix factorization. It contains the following steps:
1. It defines a matrix B and initializes matrices L and U to the identity matrix.
2. It performs Gaussian elimination to factorize the matrix B into lower triangular matrix L and upper triangular matrix U.
3. It then uses the factorization to solve the system of equations C = L*U*X by back substitution.
This document describes the Doolittle algorithm for matrix factorization. It contains the following steps:
1. It defines a matrix B and initializes matrices L and U to the identity matrix.
2. It performs Gaussian elimination to factorize the matrix B into lower triangular matrix L and upper triangular matrix U.
3. It then uses the factorization to solve the system of equations C = L*U*X by back substitution.
This document describes the Doolittle algorithm for matrix factorization. It contains the following steps:
1. It defines a matrix B and initializes matrices L and U to the identity matrix.
2. It performs Gaussian elimination to factorize the matrix B into lower triangular matrix L and upper triangular matrix U.
3. It then uses the factorization to solve the system of equations C = L*U*X by back substitution.
C = [11,5, 2, -8]; n = length(B); L = eye(n,n); U = eye(n,n); C = eye(n,1); for i = 1:n L(i,i) = 1.0; end for i = 1: n for j = 1: n A(i,j) = B(i,j); end end for k = 1:n-1 for i=(k+1):n pengali = A(i,k)/A(k,k); L(i,k) = pengali; for j = (k+1):n A(i,j) = A(i,j) - pengali*A(k,j); end end end for i = 1:n for j = i:n U(i,j) = A(i,j); end end Z = zeros(1,n); Z(1) = C(1)/L(1,1); for i = 2: n sum = 0; for j = 1: (i-1) sum = sum+L(i,j)*Z(j); end Z(i) = (C(i) - sum)/L(i,i); end Z = Z' ; X = eye(1,n); X(n) = Z(n)/U(n,n); for i = (n-1):-1:1 sum =0; for j = (i+1):n sum = sum + U(i,j)*X(j); end X(i) = (Z(i) - sum)/U(i,i);
end function det = DetByDoolittle (A) A = [1, 8, 2, -5; -2, 3, 1, 2; 4, -2, -2, 2; 4, -4, 1, 2 ];