Matlab scripts and functions for machine learning algorithm