To write a python program to find the rank of a matrix
- Hardware – PCs
- Anaconda – Python 3.7 Installation / Moodle-Code Runner
import numpy library as np
Enter the values given in the matrix as np.array[values] and assign a variable as A
Using the np.linalg.matrix_rank(), we can find the rank of the given matrix and assign a variable as Rank
Give print command as print(Rank)
import numpy as np
A=np.array([[1,2,3],[3,6,9]])
rank=np.linalg.matrix_rank(A)
print(rank)
Thus the rank for the given matrix is successfully solved by using a python program.