Multiplying two 3-dimensional matrices

2 次查看(过去 30 天)
I want to multiply (*) the conjugate of a matrix A of size 30x64x4 by a matrix B of size 64x30x4 and get a single result. How can I multiply in Matlab?

回答(1 个)

Torsten
Torsten 2023-2-4
编辑:Torsten 2023-2-4
A = rand(30,64,4);
B = rand(64,30,4);
for i = 1:size(A,3)
C1(:,:,i) = conj(A(:,:,i))*B(:,:,i);
C2(:,:,i) = B(:,:,i)*conj(A(:,:,i));
end
size(C1)
ans = 1×3
30 30 4
size(C2)
ans = 1×3
64 64 4
  2 个评论
Vecihi He
Vecihi He 2023-2-4
"size(A,3) " I don't understand why you made this expression. I want the result to be a single number, for example 0.034, when I multiply the 3D matrices A and B. How can I do it?
Torsten
Torsten 2023-2-4
I want the result to be a single number, for example 0.034, when I multiply the 3D matrices A and B.
Then you must define a new rule how to accomplish this. If you include the rule here, someone might be able to implement it.
You could start with a (3x2) and a (2x3) matrix and show us how your rule should look like for 2d-matrices.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by