Some function in Matlab for Machine Learning