Multiplying along the 3rd dimension of a 3D matrix
이전 댓글 표시
I have a 16x16x100 matrix. What is the fastest way to obtain the 16x16 product by multiplying all the 16x16 arrays?
답변 (2개)
Andrei Bobrov
2015년 3월 27일
A = rand(16,16,100);
out = A(:,:,1);
for jj = 2:size(A,3)
out = out*A(:,:,jj);
end
James Tursa
2015년 3월 27일
편집: James Tursa
2015년 3월 27일
If you mean element-wise multiply, then:
prod(your_matrix,3)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!