Fix bugs in 'segment', add postprocess MATLAB script