当前位置:   article > 正文

身份矩阵的决定因素| 使用Python的线性代数

线性代数决定因素

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库函数,我们将尝试查找身份矩阵的行列式。

用于演示身份矩阵行列式的Python代码 (Python code for demonstrating the determinant of identity matrix)

  1. # Linear Algebra Learning Sequence
  2. # Determinant of Identity Matrix
  3. import numpy as np
  4. print(np.eye(4))
  5. det_M = np.linalg.det(np.eye(4))
  6. print("Determinant : ", det_M)
  7. print("\n\n", np.eye(7))
  8. det_M = np.linalg.det(np.eye(7))
  9. print("Determinant : ", det_M)

Output:

输出:

  1. [[1. 0. 0. 0.]
  2. [0. 1. 0. 0.]
  3. [0. 0. 1. 0.]
  4. [0. 0. 0. 1.]]
  5. Determinant : 1.0
  6. [[1. 0. 0. 0. 0. 0. 0.]
  7. [0. 1. 0. 0. 0. 0. 0.]
  8. [0. 0. 1. 0. 0. 0. 0.]
  9. [0. 0. 0. 1. 0. 0. 0.]
  10. [0. 0. 0. 0. 1. 0. 0.]
  11. [0. 0. 0. 0. 0. 1. 0.]
  12. [0. 0. 0. 0. 0. 0. 1.]]
  13. Determinant : 1.0

翻译自: https://www.includehelp.com/python/determinant-of-identity-matrix.aspx

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/721905
推荐阅读
相关标签
  

闽ICP备14008679号