Dear Matlab community,
Is it possible to vectorize the following for loop:
a = rand(100,100);b = rand(500,100,100);for i = 1:500 c = reshape(b(i, :, :),100,100); d(i) = sum(sum(a.*c));end
for loopvectorization
a = rand(100,100);b = rand(500,100,100);for i = 1:500 c = reshape(b(i, :, :),100,100); d(i) = sum(sum(a.*c));end
Best Answer