'Rank' function
17 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (3 件)
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
0 件のコメント
Ahmad Karnama
2012 年 3 月 6 日
1 件のコメント
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
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!