赞
踩
Prerequisites:
先决条件:
In linear algebra, the determinant is a scalar value that can be computed for a square matrix and represents certain properties of the matrix. The determinant of a matrix A is denoted det(A) or det A or |A|. The identity matrices have determinant one and this is one of the properties of the identity matrix. Using python library function, we will try to find the determinant of identity matrices.
在线性代数中,行列式是可以为方矩阵计算的标量值,代表矩阵的某些属性。 矩阵A的行列式表示为det(A)或det A或| A |。 。 单位矩阵具有行列式1,这是单位矩阵的特性之一。 使用python库函数,我们将尝试查找身份矩阵的行列式。
- # Linear Algebra Learning Sequence
- # Determinant of Identity Matrix
-
- import numpy as np
-
- print(np.eye(4))
- det_M = np.linalg.det(np.eye(4))
- print("Determinant : ", det_M)
-
- print("\n\n", np.eye(7))
- det_M = np.linalg.det(np.eye(7))
- print("Determinant : ", det_M)
Output:
输出:
- [[1. 0. 0. 0.]
- [0. 1. 0. 0.]
- [0. 0. 1. 0.]
- [0. 0. 0. 1.]]
- Determinant : 1.0
-
-
- [[1. 0. 0. 0. 0. 0. 0.]
- [0. 1. 0. 0. 0. 0. 0.]
- [0. 0. 1. 0. 0. 0. 0.]
- [0. 0. 0. 1. 0. 0. 0.]
- [0. 0. 0. 0. 1. 0. 0.]
- [0. 0. 0. 0. 0. 1. 0.]
- [0. 0. 0. 0. 0. 0. 1.]]
- Determinant : 1.0
翻译自: https://www.includehelp.com/python/determinant-of-identity-matrix.aspx
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。