逆矩阵的几个属性:
det(A)
!= 0消元法 = 因式分解: $A = LU$
In [1]:
A = [1 3 1
1 1 -1
3 11 6]
Out[1]:
In [2]:
iA = inv(A)
Out[2]:
In [3]:
A * iA
Out[3]:
In [4]:
det(A * iA)
Out[4]:
In [14]:
L, U = lu(A, Val{false})
L
Out[14]:
In [15]:
U
Out[15]:
In [16]:
L * U
Out[16]:
In [50]:
[1 2 3; 4 5 6]'
Out[50]:
In [49]:
Q = [1/3 2/3 2/3; 2/3 1/3 -2/3; 2/3 -2/3 1/3]
isapprox(inv(Q), Q')
Out[49]:
In [51]:
B = [4 -2 -7 -4 -8
9 -6 -6 -1 -5
-2 -9 3 -5 2
9 7 -9 5 -8
-1 6 -3 9 6]
Out[51]:
In [53]:
L, U, p = lu(B)
L
Out[53]:
In [54]:
U
Out[54]:
In [55]:
p
Out[55]: