Filter löschen
Filter löschen

Multiplying two 3-dimensional matrices

3 Ansichten (letzte 30 Tage)
Vecihi He
Vecihi He am 4 Feb. 2023
Kommentiert: Torsten am 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?

Antworten (1)

Torsten
Torsten am 4 Feb. 2023
Bearbeitet: Torsten am 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 Kommentare
Vecihi He
Vecihi He am 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 am 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by