Write a NumPy program to calculate the QR decomposition of a given matrix
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
m = np.array([[1,2],[3,4]])
print("Original matrix:")
print(m)
result = np.linalg.qr(m)
print("Decomposition of the said matrix:")
print(result)
Sample Output:
Original matrix: [[1 2] [3 4]] Decomposition of the said matrix: (array([[-0.31622777, -0.9486833 ], [-0.9486833 , 0.31622777]]), array([[-3.16227766, -4.42718872], [ 0. , -0.63245553]]))
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال