The simplest way I've found to access a bus signal in a "Matlab Function", a custom code block, in Simulink. It's a bit of a pain in the butt because I have not found a way to have Simulink automatically detect the structure of a bus that you have created with a "Bus Creator" block. The structure of the bus needs to be given by a variable in the workspace. This tutorial shows how you can create a secondary Simulink model to define your bus (or busses) using "Bus Creator" blocks and then use that model to automatically define the bus signals for use in your primary model using a "Matlab Function" block.
Ещё видео!