Skip to content

Commit c8d665d

Browse files
added zscore for those without statistics toolbox. Fixes rasmusbergpalm#23. Thanks @summerstay and @gallamine
1 parent 9fe2255 commit c8d665d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

util/zscore.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function [x, mu, sigma] = zscore(x)
2+
sigma=max(std(x),eps);
3+
mu=mean(x);
4+
x=bsxfun(@minus,x,mu);
5+
x=bsxfun(@rdivide,x,sigma);
6+
end

0 commit comments

Comments
 (0)