I'm new to Matlab, so I'm not sure if this is possible. I have a simple for-loop:
for i=1:n
B.x(indexB(i)) += A.x(i);
end
Where A.x and B.x are two vectors of length n, and indexB is a vector of length n that contains the appropriate mapping from elements in A.x to B.x.
Is it possible to vectorize this loop?