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 to calculate the rank of a matrix.
now get the input from the user.
Using the np.linalg.matrix_rank(), we can find the rank of the given matrix.
using print function to print the rank of a matrix.
import numpy as np
a=([[1,2,3],[3,6,9]])
b=np.linalg.matrix_rank(a)
print(b)
Thus the rank for the given matrix is successfully solved by using a python program.
