Adding Matlab pre processing code