Matlab implementation and case of Bayesian classifier