add matlab code

add k-means algorithm
fix some bugs