I'd use Daniel's approachDaniel's approach. But just to provide an alternative:
m = 4; %// size of each initial "block" [~, ind] = sort(mod(0:numel(u)-1,m)+1); uNew = u(ind); Note that this works because, as per sort's documentation,
The ordering of the elements in B (output) preserves the order of any equal elements in A (input)