diff scripts/statistics/base/zscore.m @ 20652:a3b9ee5c040a

Replace bsxfun with broadcasting for performance with complex inputs (bug #38628). cumtrapz.m, quadgk.m, trapz.m, center.m, zscore.m: Replace bsxfun with broadcasting for performance where inputs might be complex.
author Rik <rik@octave.org>
date Mon, 12 Oct 2015 21:28:32 -0700
parents d9341b422488
children
line wrap: on
line diff
--- a/scripts/statistics/base/zscore.m	Mon Oct 12 21:13:47 2015 -0700
+++ b/scripts/statistics/base/zscore.m	Mon Oct 12 21:28:32 2015 -0700
@@ -86,8 +86,7 @@
     sigma = std (x, opt, dim);
     s = sigma;
     s(s==0) = 1;
-    ## FIXME: Use normal broadcasting once we can disable that warning
-    z = bsxfun (@rdivide, bsxfun (@minus, x, mu), s);
+    z = (x - mu) ./ s;
   endif
 
 endfunction