Multiplying along the 3rd dimension of a 3D matrix
Ältere Kommentare anzeigen
I have a 16x16x100 matrix. What is the fastest way to obtain the 16x16 product by multiplying all the 16x16 arrays?
Antworten (2)
Andrei Bobrov
am 27 Mär. 2015
A = rand(16,16,100);
out = A(:,:,1);
for jj = 2:size(A,3)
out = out*A(:,:,jj);
end
James Tursa
am 27 Mär. 2015
Bearbeitet: James Tursa
am 27 Mär. 2015
If you mean element-wise multiply, then:
prod(your_matrix,3)
1 Kommentar
T S Mahesh
am 27 Mär. 2015
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!