Multiply all combinations of rows of matrices in MATLAB -


i have 2 matrices a(3x4) , b(3x4). calculate new matrix (3x3x4) has row elements element-wise multiplication of each row of each row of b. guess it's multi-dimensional outer product. way in vectorized fashion?

bsxfun(@times, a, permute(b, [3, 2, 1])) 

or possibly

permute(bsxfun(@times, a, permute(b, [3,2,1])), [1,3,2]) 

Comments

Popular posts from this blog

google app engine - 403 Forbidden POST - Flask WTForms -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -