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?
답변 (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에서 Event Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

