For several reasons, I need to do the KNN classifier after reducing the dimension of training and sampling data. When the type is guassian, it seems that the eigenvector will be complex number so that KNN is invaild. How can I solve this problem? Thanks so much.
If you compute ||a-b||, you will have to use loops. MATLAB loops are slow, and distanceMatrix avoids using loops, thus is very fast.