home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
WINDOWS
/
DIVERSEN
/
MATHS171
/
RANK.M
< prev
next >
Wrap
Text File
|
1993-03-23
|
248b
|
13 lines
function rv = rank(x,tol)
%rv=rank(x,tol)
%computes the rank of the matrix x (using SVD)
% S.Halevy 7/31/92
% Copyright (c) 1992 by the MathWizards
s = svd(x);
if nargin<2
tol=max(size(x))*s(1)*eps;
end
rv=sum(s>tol);