Good code!!! It works very well.
However, I found a bug. In Matlab R2013
[W,M,V,L] = EM_GM(Data',k,0.001,1000,1,);
For certain k, it came out with error:
Attempted to access maxy(1); index out of bounds because numel(maxy)=0.
I noticed that some value in M were set as Nan.
However, for the same data in Matlab 7.1 it works perfectly fine.
28 Mar 2014
An expectation maximization algorithm for learning a multi-dimensional Gaussian mixture.