- Create a ‘Simulink.Bus’ object in the ‘Base Workspace’ of the model. The name of the bus object in this case would be ‘Velocity’. Add two elements to the ‘Velocity’ bus, and name them as ‘Vmin’ and ‘Vmax’ respectively. For more information on how to create ‘Simulink.Bus’ objects programmatically, please refer to the following documentation link: https://www.mathworks.com/help/releases/r2023b/simulink/ug/create-bus-objects-programmatically.html
- In the Simulink model, double click on the ‘Bus Creator’ block to open the ‘Block Parameters’ window. In the ‘Output data type’ dialogue, select the ‘Bus: <object name>’ option, and replace it with the name of the respective bus (i.e. ‘Velocity’).

- Inside the Stateflow chart, open the ‘Symbols Pane’ from the ‘Modeling’ section in the Simulink toolstrip. Right click on the ‘Velocity’ data in the symbols pane, and click on the ‘Inspect’ option. This will open a ‘Property Inspector’ window. Set the data type of the ‘Velocity’ data to ‘Bus’ as mentioned before and specify the name of the corresponding ‘Bus object’ (i.e. ‘Velocity’).

- Now you can use ‘dot indexing’ to access the elements of the ‘Velocity Bus Object’. The transition conditions can be specified as, for example, ‘Velocity.Vmax > 30’ and ‘Velocity.Vmin < 30’.