Creating and naming Simulink Buses

Hi!
I want to use buses in Simulink, and give them proper names. Some are created from a struct in an m script using:
busInfo = Simulink.Bus.createObject(myStruct);
First: in emldemo_bus_struct, where are MainBus and SubBus created and named? They are used in the blocks by setting the type to Bus: MainBus
Second: How can i give any other name than slBus1 when creating the bus in Matlab?
thanks, Håvard

 采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-11-8

0 个投票

MainBus and SubBus for this demo are loaded from a MAT-file calld businfo.mat - they are loaded from the PreLoadFcn model callback function (right-click on model and select Model Properties>Callbacks>PreLoadFcn). The name of the bus is determined by the name of the Simulink.Bus object in the workspace. You can name it to whatever other name you prefer.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Composite Interfaces 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by