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 the built-in functions for calculation.
Enter the elements of the matrix.
Calculate the inverse of the given matrix.
Print the inverse of the matrix.
#Program to find the inverse of a matrix.
#Developed by: Syed Abdul Wasih
#RegisterNumber:21002291
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.