In MATLAB Function blocks, you can define structure data as inputs or outputs that interact with bus signals. MATLAB Function blocks also support arrays of buses (for more information, see Combine Buses into an Array of Buses). You can also define structures inside MATLAB® functions that are not part of MATLAB Function blocks (see Structure Definition for Code Generation.
The following table summarizes how to create different types of structures in MATLAB Function blocks:
|Scope||How to Create||Details|
|Input||Create structure data with scope of ||You can create structure data as inputs or outputs in the top-level MATLAB function for interfacing to other environments. See Create Structures in MATLAB Function Blocks.|
|Output||Create structure data with scope of |
|Local||Create a local variable implicitly in a MATLAB function.||See Define Scalar Structures for Code Generation.|
|Persistent||Declare a variable to be persistent in a MATLAB function.||See Make Structures Persistent.|
|Parameter||Create structure data with scope of ||See Define and Use Structure Parameters.|
Structures in MATLAB Function blocks can contain fields of any type and size, including muxed signals, buses, and arrays of structures.