Revised Block Match on MATLAB