Calculate mahalanobis distance of matrix for each row
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to calculate mahalanobis distance of matrix A for each row with respect to average value of column.
I use 'mahal' function in matlab
A = [110 -100 0; 100 -100 0; 10 0 0; 0 10 0; 0 -10 20; 0 -10 10; 0 0 10;-10 -10 -10; -10 0 0];
mean_row = mean(A,1);
mahal(mean_row,A)
But it gives zero value.
The result should be:
MD = [2.0937; 1.9970; 0.9072; 0.9517; 2.2387; 1.3394; 1.0792; 2.2596;0.9072]
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!