How can I multiply N dimensional matrices

30 vues (au cours des 30 derniers jours)
Zoja Selimi
Zoja Selimi le 16 Juil 2020
Commenté : James Tursa le 17 Sep 2020
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

Réponse acceptée

KSSV
KSSV le 16 Juil 2020
C = zeros(3,4,n) ;
for i = 1:n
C(:,:,i) = A(:,:,i)*B(:,:,i) ;
end

Plus de réponses (2)

James Tursa
James Tursa le 16 Juil 2020
Modifié(e) : James Tursa le 16 Juil 2020

Steven Lord
Steven Lord le 17 Sep 2020
See the pagemtimes function introduced in release R2020b.
  1 commentaire
James Tursa
James Tursa le 17 Sep 2020
Finally! Guess I can now stop worrying about updating MTIMESX.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by