Matrix product along one of the dimensions of 3D array

32 Ansichten (letzte 30 Tage)
Svyatoslav Kharitonov
Svyatoslav Kharitonov am 28 Dez. 2017
Bearbeitet: Matt J am 13 Feb. 2024
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!

Antworten (3)

Roger Stafford
Roger Stafford am 28 Dez. 2017
P = prod(T,3);

James Tursa
James Tursa am 28 Dez. 2017

Seth Hillery
Seth Hillery am 13 Feb. 2024
If you're using release R2020b or later, take a look at the pagemtimes function introduced in that release.
  1 Kommentar
Matt J
Matt J am 13 Feb. 2024
Bearbeitet: Matt J am 13 Feb. 2024
It's not applicable, unfortunately. The OP is asking for a cumulative matrix product across the slices

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by