To write a python program to find the inverse of a matrix
- Hardware – PCs
- Anaconda – Python 3.7 Installation / Moodle-Code Runner
Import the numpy module to use built-in functions for calculations
Prepare the list from matrix's each row and assign in np.array()
Using the np.linalg.inv(), we can find the Inverse of the given matrix.
End the program
#Program to find the inverse of a matrix.
#Developed by: P.Sri Varshan
#RegisterNumber: 22008051
import numpy as np
A = np.array([[2,1,1],[1,1,1],[1,-1,2]])
B = np.linalg.inv(A)
print(B)
Thus the inverse of given matrix is successfully solved using python program