Hi all,
I am trying to construct a few groups from a given sequence by giving some pivots, one or more. For example, a = 1:15 and the pivots are 6 and 9. The desired groups are [1:3], [4:8], [7:11] and [12:15]. Is loop (brute force) the only solution?
for i = 1:length(piv)par{i} = piv(i)-length(piv):piv(i)+length(piv);endpar1 = 1:piv(1)-1;par2 = piv(2)+length(piv)+1:end;
Thanks.
Best Answer