How to concatenate vectors and matrices as inputs to a MATLAB fnc block in SIMULINK?

1 回表示 (過去 30 日間)
Bonie10
Bonie10 2020 年 11 月 11 日
コメント済み: Bonie10 2020 年 12 月 3 日
Hi,
I am having issues concatenating 3 outputs (1x1, 3x1, and 3x3) that are the inputs to a matlab function SIMULINK block. Is there a way I can concatenate or use a different approach to merge those 3 ouputs into one signal so I can use them in my matlab function block?
I have attached a picture showing the basic setup and also the error message.
Thanks!

採用された回答

Jonas
Jonas 2020 年 11 月 12 日
If you are trying to concatenate a 1x1, 3x1 and 3x3 input, how do you expect the output to look like? It's not possible...
I think you are more looking for a Bus Creator. With a bus you can 'merge' different signals of different sizes and data types. A Bus is essentially a struct from C code.
  3 件のコメント
Jonas
Jonas 2020 年 11 月 17 日
See the Simulink model "bus_as_input.slx" in attachment. Make sure to load the Bus object in mat-file "busobject.mat" in the base workspace.
Bonie10
Bonie10 2020 年 12 月 3 日
That helped, thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by