To write a program to find the LU Decomposition of a matrix.
- Hardware โ PCs
- Anaconda โ Python 3.7 Installation / Moodle-Code Runner
1.import numpy as np 2.get the input from user 3.use array function 4.assign variables to array function to get the result.
(i) To find the L and U matrix
Program to find L and U matrix using LU decomposition.
Developed by:m.s.mithun
RegisterNumber:22008364
import numpy as np
from scipy.linalg import lu
arr=eval(input())
A=np.array(arr)
P,L,U=lu(A)
print(L)
print(U)
Thus the program to find the LU Decomposition of a matrix is written and verified using python programming.