# HG changeset patch # User Rik # Date 1308408424 25200 # Node ID d9b084a3d4b025968a3fa5d24ed2de09521f0e7f # Parent 89d41b6aa661df749f47469119e56b9999f71203 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. diff --git a/scripts/statistics/distributions/cauchy_cdf.m b/scripts/statistics/distributions/cauchy_cdf.m --- 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;