MATLAB code to perform classification