'Rank' function

17 次查看(过去 30 天)
Ahmad Karnama
Ahmad Karnama 2012-3-6
I am wondering what is the output of 'rank' function in Matlab: For example:
>> A=[1 2 1 4; 2 3 1 3; 3 2 1 2; 4 3 1 1] A = 1 2 1 4 2 3 1 3 3 2 1 2 4 3 1 1 >> rank(A) ans = 3
and
>> rank(A(:,[1 2 3])) ans = 3
but
>> rank(A(:,[1 2 4])) ans = 3
and
>> rank(A(:,[1 3 4])) ans = 2
and
>> rank(A(:,[2 3 4])) ans = 3
Thanks in advance if someone tell me what are the output numbers?

回答(3 个)

Thomas
Thomas 2012-3-6
doc rank
The rank function provides an estimate of the number of linearly independent rows or columns of a full matrix.
k = rank(A) returns the number of singular values of A that are larger than the default tolerance, max(size(A))*eps(norm(A)).
k = rank(A,tol) returns the number of singular values of A that are larger than tol

Ahmad Karnama
Ahmad Karnama 2012-3-6
Thanks Thomas! I read this on the website and matlab help but I am wondering it it estimated the linearly independent 'rows' or 'columns'?? and how can you interpret the results I am getting? Regards, Ahmad
  1 个评论
Thomas
Thomas 2012-3-6
A
A =
1.00 2.00 1.00 4.00
2.00 3.00 1.00 3.00
3.00 2.00 1.00 2.00
4.00 3.00 1.00 1.00
>> A(:,[2 3 4])
ans =
2.00 1.00 4.00
3.00 1.00 3.00
2.00 1.00 2.00
3.00 1.00 1.00
>> A(:,[1 2 3])
ans =
1.00 2.00 1.00
2.00 3.00 1.00
3.00 2.00 1.00
4.00 3.00 1.00
>> rank(A(:,[1 2 3]))
ans =
3.00
A(:,[1 2 3]) gives a new matrix with col 1,2 and 3 from A
and
rank(A(:,[1 2 3]))
ans =
3.00
gives the rank of this new matrix..

请先登录,再进行评论。


Jan
Jan 2012-3-6
A = [1 2 1 4; 2 3 1 3; 3 2 1 2; 4 3 1 1]
rank(A) ans = 3
This means, that A has 3 independend rows or columns.
rank(A(:,[1 2 3])) ans = 3
The first three columns are independent.
rank(A(:,[1 2 4])) ans = 3
The columns 1,2,3 are also independent.
rank(A(:,[1 3 4])) ans = 2
One vector of this set is a linear combination of the two others.
rank(A(:,[2 3 4])) ans = 3
These three columns are independent again.
This is only the application of the definition Thomas has given already. Therefore I do not understand the problem.

类别

Help CenterFile Exchange 中查找有关 Sparse Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by