Does anyone have a suggestion on how I can optimize this nested loop? Is it possible to do this faster by just using sum? O, L, and W are of arbitrary size.
A = zeros(size(W));
for m = 1:size(O,1)
for pix = 1:NumPixels
A = A + O(m,pix) .* ( L(:,:,m,pix) ./ W ) ./ (sum( sum( L(:,:,m,pix) , 1 ) , 2 ) );
end
end
Best Answer