Multiplying m*m*N matrix internally

5 ビュー (過去 30 日間)
voxynn
voxynn 2018 年 1 月 11 日
コメント済み: voxynn 2018 年 1 月 11 日
I have a matrix A with dimensions 2*2*N, and I would like to multiply each 2*2 'slice' of the matrix together to end up with a final 2*2 matrix. I've tried using prod but I haven't had much luck. Is there a better way, or a particular syntax to use? Thanks!

採用された回答

M
M 2018 年 1 月 11 日
prod
performs element-wise multiplication.
If you want matrix multiplication, you can use something like :
A = rand(2,2,2);
res = A(:,:,1);
for i = 2:size(A,3)
res = res*A(:,:,i);
end
  1 件のコメント
voxynn
voxynn 2018 年 1 月 11 日
Excellent, thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by