#範例3-6:用sympy計算反矩陣,但是不可能矩陣,沒有反矩陣 from sympy import * A = Matrix([ [1, 6,4], [2, 4,-1], [-1, 2,5] ]) A_inv = A.inv() print('矩陣A=\n', A_inv)