Mercurial > octave-nkf
diff scripts/linear-algebra/rank.m @ 2311:2b5788792cad
[project @ 1996-07-11 20:18:38 by jwe]
author | jwe |
---|---|
date | Thu, 11 Jul 1996 20:18:38 +0000 |
parents | 5cffc4b8de57 |
children | 5ca126254d15 |
line wrap: on
line diff
--- a/scripts/linear-algebra/rank.m Thu Jul 11 20:02:03 1996 +0000 +++ b/scripts/linear-algebra/rank.m Thu Jul 11 20:18:38 1996 +0000 @@ -17,19 +17,19 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -function retval = rank (A, tol) +## usage: rank (a, tol) +## +## Return the rank of the matrix a. The rank is taken to be the number +## of singular values of a that are greater than tol. +## +## If the second argument is omitted, it is taken to be +## +## tol = max (size (a)) * sigma (1) * eps; +## +## where eps is machine precision and sigma is the largest singular +## value of a. - ## usage: rank (a, tol) - ## - ## Return the rank of the matrix a. The rank is taken to be the number - ## of singular values of a that are greater than tol. - ## - ## If the second argument is omitted, it is taken to be - ## - ## tol = max (size (a)) * sigma (1) * eps; - ## - ## where eps is machine precision and sigma is the largest singular - ## value of a. +function retval = rank (A, tol) if (nargin == 1) sigma = svd (A);