Yeah, write your wanted input and allocation-arrays for a couple of steps. Something like:
f = [1 2 3 4];
S_from_f = {[1],[2,3],[3,7],[4,5,6]};
to_S = {[2],[3,4],[4,9],[5,6,12]};
for i1 = 1:numel(f),
for i2 = 1:numel(S_from_f{i1})
Pf1(:,to_S{i1}(i2))=Pf1BM1.allocation(:,S_from_f{i1}(i2));
etc...
end
end
You'll have to figure out how to organize your indices to get the right assignments and such...
HTH