You've (almost) already written out a list comprehension syntax to do this. 
Generally I think you wouldn't want to have a couple of vectors and a 
couple of matrices, but the vectors stored as (e.g.) rows of a matrix, and 
the matrices stored as slices of a three-dimensional array. E.g.:

vectors = [1 2; 3 4]
matrices = zeros(Int64, (2,2,2))
matrices[:,:,1] = vectors*2
matrices[:,:,2] = vectors*3

[[vectors[:,i]'*matrices[:,:,j] for i = 1:2] for j = 1:2]

I would personally argue that a loop is easier to read/understand, but your 
mileage may vary...

Reply via email to