Added a function sample_split.m