function B = partestA = 1:4; B = zeros(1,4);parfor j=1:2 B([j j+2]) = A([j+2 j]);end
The two bits of the loop access different bits of B, so there should be some way of doing this. My actual application involves large cell arrays, for which something similar holds for the function within the loop.
Best Answer