필터 지우기
필터 지우기

Vector-Matrix multiplication along third dimension

조회 수: 20 (최근 30일)
GT
GT 2015년 10월 26일
답변: GT 2015년 10월 26일
Hi,
we consider a N long vector (v = v1, v2, ..., vN) and a m x m x N array (A = A1, A2, ..., AN. Ai is a m x m matrix). The goal is ultimately to produce matrix B: B = v1*A1 + v2*A2 + ... + vN*AN
The trick is we may not us a for loop here. N is not known in advance. All this has to be reproduced in SIMULINK. I'm aware of the Array-Vector Multiply block in the DSP Toolbox, but we'd like to work without that toolbox.
Thank you for your help.
All the best, Guillaume

채택된 답변

Andrei Bobrov
Andrei Bobrov 2015년 10월 26일
B = bsxfun(@times,A,reshape(v,1,1,[]));

추가 답변 (1개)

GT
GT 2015년 10월 26일
Perfect! Works very well. Thank you

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by