Can this for loop be vectorized or use parfor instead? If so, how should I do it?
for edgeID = 1:size(IE,1) self = selfs(edgeID); sdl(self) = sdl(self)+sdl_edge(edgeID); % add frac to self
res(:,self) = res(:,self)+flux_edge(:,edgeID); % add flux to self residual
end % internal edge iteration ends
"selfs" is an array with some order. That means I want to loop over this "order array" and fill in some value according to that order (not in the order of 12345).
I have tried several ways but failed…
Best Answer