Mercurial > hg > octave-lyh
diff scripts/statistics/distributions/geornd.m @ 10525:3306cfcb856e
Replace constructs like "NaN * one()" with "NaN()" and "Inf * ones ()" with "Inf()"
author | David Bateman <dbateman@free.fr> |
---|---|
date | Fri, 16 Apr 2010 10:32:07 +0200 |
parents | 16f53d29049f |
children | 95c3e38098bf |
line wrap: on
line diff
--- a/scripts/statistics/distributions/geornd.m +++ b/scripts/statistics/distributions/geornd.m @@ -68,9 +68,9 @@ if (isscalar (p)) if (!(p >= 0) || !(p <= 1)) - rnd = NaN * ones (sz); + rnd = NaN (sz); elseif (p == 0) - rnd = Inf * ones (sz); + rnd = Inf (sz); elseif ((p > 0) & (p < 1)); rnd = floor (- rande(sz) ./ log (1 - p)); else @@ -81,12 +81,12 @@ k = find (!(p >= 0) | !(p <= 1)); if (any (k)) - rnd(k) = NaN * ones (1, length (k)); + rnd(k) = NaN (1, length (k)); endif k = find (p == 0); if (any (k)) - rnd(k) = Inf * ones (1, length (k)); + rnd(k) = Inf (1, length (k)); endif endif