首页 > 编程知识 正文

python矩阵中插入矩阵Python 矩阵等级

时间:2023-05-06 11:10:42 阅读:269787 作者:3102

python矩阵中插入矩阵

The rank of a Matrix is defined as the number of linearly independent columns present in a matrix. The number of linearly independent columns is always equal to the number of linearly independent rows. In this article, we are going to find Rank of a Matrix.

矩阵等级定义为矩阵中存在的线性独立列的数量。 线性独立列的数量始终等于线性独立行的数量。 在本文中,我们将找到矩阵的等级

There is an inbuilt function defined in numpy.linalg package as shown below,

numpy.linalg包中定义了一个内置函数,如下所示,

rank = numpy.linalg.matrix_rank(a) Python代码查找矩阵的等级 (Python code to find rank of a matrix) # Linear Algebra Learning Sequence# Rank of a Matriximport numpy as npa = np.array([[4,5,8], [7,1,4], [5,5,5], [2,3,6]])rank = np.linalg.matrix_rank(a)print('Matrix : ', a)print('Rank of the given Matrix : ',rank)

Output:

输出:

Matrix : [[4 5 8] [7 1 4] [5 5 5] [2 3 6]]Rank of the given Matrix : 3

翻译自: https://www.includehelp.com/python/rank-of-a-matrix.aspx

python矩阵中插入矩阵

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。