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