// This function returns the value of a Mahalanobis Distance minimum // distance classifier at x, given the mean vectors and covariance // matrices of the two populations. function [r]= md_disc (x, U1, U2, C1, C2) I1 = inv (C1); I2 = inv (C2); g1 = sqrt ((x-U1)' * I1 * (x-U1)); g2 = sqrt ((x-U2)' * I2 * (x-U2)); r = g1 - g2;