フィルターのクリア

Matrix product along one of the dimensions of 3D array

18 ビュー (過去 30 日間)
Svyatoslav Kharitonov
Svyatoslav Kharitonov 2017 年 12 月 28 日
編集済み: Matt J 2024 年 2 月 13 日
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!

回答 (3 件)

Roger Stafford
Roger Stafford 2017 年 12 月 28 日
P = prod(T,3);
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 12 月 28 日
That would do the equivalent of .* instead of *

サインインしてコメントする。


James Tursa
James Tursa 2017 年 12 月 28 日

Seth Hillery
Seth Hillery 2024 年 2 月 13 日
If you're using release R2020b or later, take a look at the pagemtimes function introduced in that release.
  1 件のコメント
Matt J
Matt J 2024 年 2 月 13 日
編集済み: Matt J 2024 年 2 月 13 日
It's not applicable, unfortunately. The OP is asking for a cumulative matrix product across the slices

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by