MATLAB: Vector to repeated matrix multiplication

matrix vector element multiplication and summing

Hi all.
Just wanted to find a non loop way of computing the following operation.
A = [1 2; 3 4], V = [ 1 2 3]
compute Y = 1*A + 2*A + 3*A = 1*[1 2; 3 4] + 2*[1 2; 3 4] + 3*[1 2; 3 4] = [6 12; 18 24]
i.e. each element of V times A then sum up each of these matrices
many thanks!

Best Answer

One approach:
sum(bsxfun(@times,A,reshape(V,1,1,3)),3)