0
votes

Does anyone know how to do array matrix multiplication in matlab? i.e. I have two 3 dimensional arrays consisting of sets of matrices in the first 2 dimensions and I would like to multiply each matrix in the first array with the corresponding one in the second array. So, i.e. if

A=randn(3,3);
B=cat(3,A,A); 

I would like [[operation]] such that

B[[operation]]B = cat(3,A*A, A*A) 

done in efficient vector form.

Many thanks in advance.

1
Perhaps I don't understand the requirements, but what is wrong with: C = A*A followed by cat(3,C,C) - Dennis Jaheruddin

1 Answers

1
votes

I have used MULTIPROD from the Mathworks FileExchange for N-D array multiplication before. It is basically an extension of bsxfun to N-D arrays, and works quite nicely (and fast) - although the interface is a bit cumbersome.