Multiplying along the 3rd dimension of a 3D matrix
Mostrar comentarios más antiguos
I have a 16x16x100 matrix. What is the fastest way to obtain the 16x16 product by multiplying all the 16x16 arrays?
Respuestas (2)
Andrei Bobrov
el 27 de Mzo. de 2015
A = rand(16,16,100);
out = A(:,:,1);
for jj = 2:size(A,3)
out = out*A(:,:,jj);
end
James Tursa
el 27 de Mzo. de 2015
Editada: James Tursa
el 27 de Mzo. de 2015
If you mean element-wise multiply, then:
prod(your_matrix,3)
1 comentario
T S Mahesh
el 27 de Mzo. de 2015
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!