Prerequisites:
先决条件:
Defining a Matrix
定义矩阵
Identity Matrix
身份矩阵
There are matrices whose inverse is the same as the matrices and one of those matrices is the identity matrix.
有些矩阵的逆与矩阵相同,并且这些矩阵之一是单位矩阵。
I-.1 = I
Syntax:
句法:
inv_M = numpy.linalg.inv(I)
Here, "M" is the an identity matrix.
在此,“ M”是单位矩阵。
Python代码查找单位矩阵的逆矩阵 (Python code to find the inverse of an identity matrix)
# Linear Algebra Learning Sequence
# Inverse of a Identity Matrix
import numpy as np
I = np.eye(6)
print("---Matrix I---\n", I)
ai = np.linalg.inv(I)
print('\n\nInverse of A as ----\n', ai)
print('\n\nThe Matrices are same')
Output:
输出:
---Matrix I---
[[1. 0. 0. 0. 0. 0.]
[0. 1. 0. 0. 0. 0.]
[0. 0. 1. 0. 0. 0.]
[0. 0. 0. 1. 0. 0.]
[0. 0. 0. 0. 1. 0.]
[0. 0. 0. 0. 0. 1.]]
Inverse of A as ----
[[1. 0. 0. 0. 0. 0.]
[0. 1. 0. 0. 0. 0.]
[0. 0. 1. 0. 0. 0.]
[0. 0. 0. 1. 0. 0.]
[0. 0. 0. 0. 1. 0.]
[0. 0. 0. 0. 0. 1.]]
The Matrices are same
翻译自: https://www.includehelp.com/python/inverse-of-an-identity-matrix.aspx