参考
MATLAB解释
rank uses a method based on the singular value decomposition, or SVD. The SVD algorithm is more time consuming than some alternatives, but it is also the most reliable.
The rank of a matrix A is computed as the number of singular values that are larger than a tolerance. By default, the tolerance is max(size(A))*eps(norm(A)). However, you can specify a different tolerance with the command rank(A,tol).
秩使用一种基于奇异值分解的方法,或SVD。SVD算法虽然比其他算法更耗时,但也是最可靠的算法。
矩阵a的秩是根据奇异值大于容差的个数来计算的。缺省情况下,公差为max(size(A))*eps(norm(A))。但是,您可以使用命令级别(a,tol)指定不同的容忍范围。
计算
tol = max(size(A))*eps(norm(A)) | scalar
rank(A,tol)
或者
s = svd(A);
tol = max(size(A))*eps(max(s));
r = sum(s > tol);
下面这个就是上面的原理。
网友评论