Mercurial > hg > octave-nkf
changeset 12752:d9b084a3d4b0 stable
cauchy_cdf.m: Correction to fix to allow -Inf, Inf inputs
* cauchy_cdf.m: Select all x values with ones(size(x)) before
excluding any values due to bad location or scale parameters.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 18 Jun 2011 07:47:04 -0700 |
parents | 89d41b6aa661 |
children | 00fbb05f099c |
files | scripts/statistics/distributions/cauchy_cdf.m |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/statistics/distributions/cauchy_cdf.m +++ b/scripts/statistics/distributions/cauchy_cdf.m @@ -48,8 +48,8 @@ sz = size (x); cdf = NaN (sz); - k = find ((location > -Inf) & (location < Inf) - & (scale > 0) & (scale < Inf)); + k = find (ones (sz) & (location > -Inf) & (location < Inf) + & (scale > 0) & (scale < Inf)); if (any (k)) if (isscalar (location) && isscalar (scale)) cdf(k) = 0.5 + atan ((x(k) - location) ./ scale) / pi;