How to multiply arrays to create a larger one

조회 수: 3 (최근 30일)
Raz Firanko
Raz Firanko 2020년 11월 25일
편집: per isakson 2020년 11월 27일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by