Mercurial > hg > octave-lyh
diff scripts/statistics/distributions/laplace_inv.m @ 4859:265d566cc770
[project @ 2004-04-08 23:52:45 by jwe]
author | jwe |
---|---|
date | Thu, 08 Apr 2004 23:52:45 +0000 |
parents | 38c61cbf086c |
children | 4c8a2e4e0717 |
line wrap: on
line diff
--- a/scripts/statistics/distributions/laplace_inv.m +++ b/scripts/statistics/distributions/laplace_inv.m @@ -32,19 +32,16 @@ usage ("laplace_inv (x)"); endif - [r, c] = size (x); - s = r * c; - x = reshape (x, 1, s); - inv = (-Inf) * ones (1, s); + inv = (-Inf) * ones (size (x)); k = find (isnan (x) | (x < 0) | (x > 1)); if (any (k)) - inv(k) = NaN * ones (1, length (k)); + inv(k) = NaN; endif k = find (x == 1); if (any (k)) - inv(k) = Inf * ones (1, length (k)); + inv(k) = Inf; endif k = find ((x > 0) & (x < 1)); @@ -53,6 +50,4 @@ - (x(k) > 1/2) .* log (2 * (1 - x(k)))); endif - inv = reshape (inv, r, c); - -endfunction \ No newline at end of file +endfunction