Buses in a Simulink® model appear inside the MATLAB Function block as structures; structure outputs from the MATLAB Function block appear as buses in Simulink models. When you create structure inputs, the MATLAB Function block determines the type, size, and complexity of the structure from the input signal. When you create structure outputs, you must define their type, size, and complexity in the MATLAB® function.
You connect structure inputs and outputs from MATLAB Function blocks to any bus signal, including:
Blocks that output bus signals — such as Bus Creator blocks
Blocks that accept bus signals as input — such as Bus Selector and Gain blocks
Other MATLAB Function blocks
MATLAB Function blocks supports nonvirtual buses only (see Virtual and Nonvirtual Buses). When models that contain MATLAB Function block inputs and outputs are built, hidden converter blocks are used to convert bus signals for code generation from MATLAB, as follows:
Converts incoming virtual bus signals to nonvirtual buses for inputs to structures in MATLAB Function blocks
Converts outgoing nonvirtual bus signals from MATLAB Function blocks to virtual bus signals