changeset 22214:0ff3bd7d2750

mahalanobis: alternative for performance improvement (bug #45877)
author Lachlan Andrew <lachlanbis@gmail.com>
date Sat, 06 Aug 2016 23:47:20 +0100
parents 1723063e65f3
children f99c0b8cb67b
files scripts/deprecated/mahalanobis.m
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/deprecated/mahalanobis.m	Sat Aug 06 05:18:34 2016 +0100
+++ b/scripts/deprecated/mahalanobis.m	Sat Aug 06 23:47:20 2016 +0100
@@ -76,13 +76,10 @@
 
   w = (x' * x + y' * y) / (xr + yr - 2);
 
-  winv = inv (w);
-
-  retval = (xm - ym) * winv * (xm - ym)';
+  retval = sumsq ((xm - ym) / chol (w));
 
 endfunction
 
-
 ## Test input validation
 %!error mahalanobis ()
 %!error mahalanobis (1, 2, 3)