Mercurial > hg > octave-nkf
diff scripts/polynomial/residue.m @ 5464:9d0aab486882
[project @ 2005-09-22 21:31:39 by jwe]
author | jwe |
---|---|
date | Thu, 22 Sep 2005 21:31:39 +0000 |
parents | ab7973a599cf |
children | 2618a0750ae6 |
line wrap: on
line diff
--- a/scripts/polynomial/residue.m +++ b/scripts/polynomial/residue.m @@ -205,19 +205,14 @@ p = roots (a); lp = length (p); + ## Determine if the poles are (effectively) zero. - ## Determine if the poles are (effectively) zero. - index = find (abs (p) < toler); - if (length (index) != 0) - p (index) = 0; - endif + p(abs (p) < toler) = 0; ## Determine if the poles are (effectively) real. - index = find (abs(p)>=toler && ( abs(imag(p)) ./ abs(p) < toler )); - if (length (index) != 0) - p (index) = real (p (index)); - endif + index = (abs (p) >= toler && (abs (imag (p)) ./ abs (p) < toler)); + p(index) = real (p(index)); ## Find the direct term if there is one.