Element wise multiplication of a 4D Matrix
2 ビュー (過去 30 日間)
古いコメントを表示
Say I have a 4D matrix called X_values the size of 3x3x3x10. I wanted to do an element wise multiplication along the 4th dimension and obtain a 3x3x3 matrix at the end. Any recommendation on how to do it?
0 件のコメント
回答 (1 件)
John D'Errico
2023 年 12 月 4 日
編集済み: John D'Errico
2023 年 12 月 4 日
A confusing question. MAYBE you are asking how to take the product of the elements along the 4th dimension? That is consistent with what you are asking for a result. And that is trivial. Just use prod. It works just like sum.
A = rand(3,3,3,10); % just create a matrix of the right shape
B = prod(A,4);
size(B)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!