3D matrix multiplications

조회 수: 4 (최근 30일)
Alexandra
Alexandra 2016년 4월 26일
답변: Andrei Bobrov 2016년 4월 26일
Hi,
I have a A(nxa) matrix and a B(1xp) matrix. I'm trying to multiplicate A by B, creating a C(nxaxp) matrix (3D), where the reality nxa is multiplied by each value of p, creating p realities.
Any direct/efficient way of doing this without the for loop?
Thank you very much,

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2016년 4월 26일
C = bsxfun(@times,A,reshape(B,1,1,[]));

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by