Mercurial > hg > octave-nkf
comparison scripts/statistics/base/center.m @ 20828: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 |
comparison
equal
deleted
inserted
replaced
20827:e54ecb33727e | 20828:a3b9ee5c040a |
---|---|
68 n = sz(dim); | 68 n = sz(dim); |
69 | 69 |
70 if (n == 0) | 70 if (n == 0) |
71 retval = x; | 71 retval = x; |
72 else | 72 else |
73 retval = bsxfun (@minus, x, mean (x, dim)); | 73 retval = x - mean (x, dim); |
74 endif | 74 endif |
75 | 75 |
76 endfunction | 76 endfunction |
77 | 77 |
78 | 78 |