线性代数分块矩阵求逆矩阵
Prerequisites:
先决条件:
Defining Matrix
定义矩阵
Identity matrix
身份矩阵
numpy.matmul( ) matrix multiplication
numpy.matmul()矩阵乘法
In linear algebra, the identity matrix, of size n is the n × n square matrix with ones on the main diagonal and zeros elsewhere. It is denoted by I. The identity matrix has the property that: AI = A
在线性代数中,大小为n的单位矩阵是n×n方阵,主对角线上为1,其他地方为零。 用I表示。 单位矩阵具有以下特性: AI = A
身份矩阵属性的Python代码(AI = A) (Python code for identity matrix property (AI = A))
# Linear Algebra Learning Sequence
# Identity Matrix Property (AI = A)
import numpy as np
I = np.eye(3)
print("---Matrix I---\n", I)
A = np.array([[2,3,4], [3,45,8], [4,8,78]])
print("---Matrix A---\n", A)
ai = np.matmul(A,I)
print('\nIdentity Matrix Property I.A----\n', ai)
if ai.all() == I.all():
print("AI = A")
Output:
输出:
---Matrix I---
[[1. 0. 0.]
[0. 1. 0.]
[0. 0. 1.]]
---Matrix A---
[[ 2 3 4]
[ 3 45 8]
[ 4 8 78]]
Identity Matrix Property I.A----
[[ 2. 3. 4.]
[ 3. 45. 8.]
[ 4. 8. 78.]]
翻译自: https://www.includehelp.com/python/identity-matrix-property-ai-a.aspx
线性代数分块矩阵求逆矩阵