How do I input a struct as an input to a custom matlab simulink function?
13 次查看(过去 30 天)
显示 更早的评论
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 个)
Sai Sri Pathuri
2020-2-26
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/273726/image.png)
Hence, you need to set the datatype of bus input as Bus: slBus1.
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!