What is LU Decomposition: LU Decomposition (Acronym of Lower-upper Decomposition): In 1948, Alan Turing was the man to introduce the LU Decomposition method to the world. It is a factorization process to convert a given square shape matrix into two triangular matrices (L- Lower triangular and U- Upper triangular matrix).
Application of LU Decomposition:
- This process is used to finding current in a circuit.
- To find the inverse of a matrix.
- To find the determinant of a matrix.
LU Decomposition or Factorization Matlab Code:
-------------start---------------
GMat=[25 5 1
64 8 1
144 12 1]
shape=size(GMat);
L=eye(shape);
U=GMat;
for i=1:shape(2)-1
for j=i+1:shape(1)
factor=U(j,i)/U(i,i);
U(j,:)=-(U(i,:)*factor)+U(j,:);
L(j,i)=factor;
end
end
L
U
-------------end---------------
The above Matlab code is implemented according to the theory of LU Decomposition.
Tags:
Matlab