How to multiply arrays to create a larger one

2 vues (au cours des 30 derniers jours)
Raz Firanko
Raz Firanko le 25 Nov 2020
Modifié(e) : per isakson le 27 Nov 2020
Let's say I have the following two arrays
A=rand(3,4,3)
B=rand(3,5)
I want to generate the specific "tensor product", for example:
C(:,:,:)=A(1,:,:)*B(2.:)
Such that C is an 4x3x5 array which it's (i,j,k) entry is A(1,i,j)*B(2,k).
However, it seems that the regular multiplication operator does not fit my needs.
How do I do that in Matlab?

Réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by