Changed the way to sample training examples for random forest
Revised the MATLAB wrappers