I am trying to multiply a 3x3xn matrix with a 3x4xn matrix.
I tried a for loop but it says that the matrix dimensions do not agree.
The new matrix that I need is just the product of the first A(:,:,i)*B(:,:,i) which should work but in my case it isn't

 채택된 답변

KSSV
KSSV 2020년 7월 16일

1 개 추천

C = zeros(3,4,n) ;
for i = 1:n
C(:,:,i) = A(:,:,i)*B(:,:,i) ;
end

추가 답변 (2개)

Steven Lord
Steven Lord 2020년 9월 17일

0 개 추천

See the pagemtimes function introduced in release R2020b.

댓글 수: 1

James Tursa
James Tursa 2020년 9월 17일
Finally! Guess I can now stop worrying about updating MTIMESX.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2020년 7월 16일

댓글:

2020년 9월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by