How do I input a struct as an input to a custom matlab simulink function?
古いコメントを表示
I have a struct which defines constants and vectors for aerodynamics surfaces on an aircraft. How do I create a bus with a struct input?
1 件のコメント
stozaki
2020 年 2 月 23 日
Can you use stateflow?
回答 (2 件)
Alok Virkar
2020 年 2 月 26 日
編集済み: Alok Virkar
2020 年 2 月 26 日
Sai Sri Pathuri
2020 年 2 月 26 日
0 投票
When you created the bus object using Simulink.Bus.createObject, a structure s2Bus and a bus object slBus1 are created. Assigning the bus name as 's2Bus' has only changed the field 'busName' in s2Bus structure but the name of bus object is still slBus1. (as you can see in below figure)

Hence, you need to set the datatype of bus input as Bus: slBus1.
3 件のコメント
Alok Virkar
2020 年 3 月 1 日
Sai Sri Pathuri
2020 年 3 月 4 日
Can you attach the simulink model?
Alok Virkar
2020 年 4 月 28 日
編集済み: Alok Virkar
2020 年 4 月 28 日
カテゴリ
ヘルプ センター および File Exchange で String についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

