Multiplying two 3-dimensional matrices

2 visualizzazioni (ultimi 30 giorni)
Vecihi He
Vecihi He il 4 Feb 2023
Commentato: Torsten il 4 Feb 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?

Risposte (1)

Torsten
Torsten il 4 Feb 2023
Modificato: Torsten il 4 Feb 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 Commenti
Vecihi He
Vecihi He il 4 Feb 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 il 4 Feb 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.

Accedi per commentare.

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by