フィルターのクリア

3D matrix multiplications

2 ビュー (過去 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 Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by