Matrix product along one of the dimensions of 3D array
Mostra commenti meno recenti
Dear all,
I wonder whether there is simple and elegant way (avoiding FOR loops) to compute a matrix product of multidimensional (e.g. 3D) array along one of the dimensions: for instance there is a T(2x2x1000) array, and one would like to compute T(:,:,1)*T(:,:,1)*...*T(:,:,1000).
Thank you!
Risposte (3)
Roger Stafford
il 28 Dic 2017
P = prod(T,3);
1 Commento
Walter Roberson
il 28 Dic 2017
That would do the equivalent of .* instead of *
James Tursa
il 28 Dic 2017
1 voto
Seth Hillery
il 13 Feb 2024
0 voti
If you're using release R2020b or later, take a look at the pagemtimes function introduced in that release.
1 Commento
Categorie
Scopri di più su Multidimensional Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!