필터 지우기
필터 지우기

'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