How to multiply row and column vectors in Simulink

6 ビュー (過去 30 日間)
viferi
viferi 2022 年 9 月 8 日
回答済み: Mark McBroom 2022 年 9 月 10 日
I would like to multiply a row and a column vector using Simulink.
Example in MATLAB:
a = [11 12 13 14 15];
b = [1;2;3];
c=a.*b
c = 3×5
11 12 13 14 15 22 24 26 28 30 33 36 39 42 45
I could not perform this simple operation using Simulink block:
What am I doing wrong, how can I make row-column vector multiplication via Simulink?
Thank you in advance!

回答 (1 件)

Mark McBroom
Mark McBroom 2022 年 9 月 10 日
Your MATLAB code takes advantage of implicit expansion. This feature is not available in Simulink. You'll need to update your model to convert the vectors to matrices with compatible sizes.

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by