diff scripts/statistics/distributions/logistic_inv.m @ 4859:265d566cc770

[project @ 2004-04-08 23:52:45 by jwe]
author jwe
date Thu, 08 Apr 2004 23:52:45 +0000 (2004-04-08)
parents 38c61cbf086c
children 4c8a2e4e0717
line wrap: on
line diff
--- a/scripts/statistics/distributions/logistic_inv.m
+++ b/scripts/statistics/distributions/logistic_inv.m
@@ -32,24 +32,21 @@
     usage ("logistic_inv (x)");
   endif
 
-  [r, c] = size (x);
-  s = r * c;
-  x = reshape (x, 1, s);
-  inv = zeros (1, s);
+  inv = zeros (size (x));
 
   k = find ((x < 0) | (x > 1) | isnan (x));
   if (any (k))
-    inv(k) = NaN * ones (1, length (k));
+    inv(k) = NaN;
   endif
 
   k = find (x == 0);
   if (any (k))
-    inv(k) = (-Inf) * ones (1, length (k));
+    inv(k) = -Inf;
   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));
@@ -57,6 +54,4 @@
     inv (k) = - log (1 ./ x(k) - 1);
   endif
 
-  inv = reshape (inv, r, c);
-
 endfunction