comparison scripts/linear-algebra/rank.m @ 904:3470f1e25a79

[project @ 1994-11-09 21:22:15 by jwe]
author jwe
date Wed, 09 Nov 1994 21:22:15 +0000
parents 5f18dd3a9b61
children 3f257ab07921
comparison
equal deleted inserted replaced
903:b3692d63cca3 904:3470f1e25a79
1 # Copyright (C) 1993 John W. Eaton 1 # Copyright (C) 1993, 1994 John W. Eaton
2 # 2 #
3 # This file is part of Octave. 3 # This file is part of Octave.
4 # 4 #
5 # Octave is free software; you can redistribute it and/or modify it 5 # Octave is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the 6 # under the terms of the GNU General Public License as published by the
35 tolerance = max (size (A)) * sigma (1) * eps; 35 tolerance = max (size (A)) * sigma (1) * eps;
36 elseif (nargin == 2) 36 elseif (nargin == 2)
37 sigma = svd (A); 37 sigma = svd (A);
38 tolerance = tol; 38 tolerance = tol;
39 else 39 else
40 error ("usage: rank (A)"); 40 usage ("rank (A)");
41 endif 41 endif
42 retval = sum (sigma > tolerance); 42 retval = sum (sigma > tolerance);
43 43
44 endfunction 44 endfunction