MATLAB: Can’t I see the bus object after using simulink.B​us.CreateO​bject

simulink

I'm trying to create bus objects from "Bus Creator" blocks with:
>> simulink.Bus.CreateObject(model, blocks)
This seems to work for the example models supplied in the documentation. For a working demo, my base workspace shows:

However, when using it on my model, I only get a struct – the bus object seems to be missing:

Best Answer

  • If the model has a linked data dictionary (SLDD), then the bus object definition will be located there instead of the base workspace. The doc was updated starting in R2019b to reflect this.
    R2019a doc (mentions output to base workspace)
    https://www.mathworks.com/help/releases/R2019a/simulink/slref/simulink.bus.createobject.html
    R2019b doc (mentions output to base workspace and SLDD)
    https://www.mathworks.com/help/releases/R2019b/simulink/slref/simulink.bus.createobject.html