I have following data:
s{1} = 1:10;s{2} = 19:27;s{3} = 29:41;s{4} = 59:67;s{5} = 71:89;s{6} = 91:110;s{7} = 119:210;s{8} = 214:290;
and I want to combine sets with difference less than 4
diff = s{2}(1)-s{1}(end) if diff <4 combine s{1}and s{2}
My out should be:
s{1} = 1:10;s{2} = 19:41;s{3} = 59:67;s{4} = 71:110;s{5} = 119:210;s{6} = 214:290;
Best Answer