问题描述
求解代码
import numpy as np A = np.array([[7, 3, 0, 1], [0, 1, 0, -1], [1, 0, 6, -3], [1, 1, -1, -1]]) B = np.array([8, 6, -3, 1]) X = np.linalg.inv(A).dot(B) print("x是:{} ".format(X[0])) print("y是:{} ".format(X[1])) print("z是:{} ".format(X[2])) print("k是:{} ".format(X[3]))
结果