Multiplying two 3-dimensional matrices

1 visualización (últimos 30 días)
Vecihi He
Vecihi He el 4 de Feb. de 2023
Comentada: Torsten el 4 de Feb. de 2023
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?

Respuestas (1)

Torsten
Torsten el 4 de Feb. de 2023
Editada: Torsten el 4 de Feb. de 2023
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 comentarios
Vecihi He
Vecihi He el 4 de Feb. de 2023
"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 el 4 de Feb. de 2023
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by