A structure array is a data type that groups related data using data
containers called fields. Each field can contain any type of data. Access
data in a structure using dot notation of the form
structName.fieldName. For more information, see Structure Arrays or
watch Introducing Structures and Cell Arrays.
|Field names of structure, or public fields of Java or Microsoft COM object|
|Field of structure array|
|Determine if input is structure array field|
|Determine if input is structure array|
|Order fields of structure array|
|Remove fields from structure|
|Assign value to structure array field|
|Apply function to each element of array|
|Apply function to each field of scalar structure|
|Convert table to structure array|
|Convert structure array to table|
|Convert cell array to structure array|
|Convert structure to cell array|
- Structure Arrays
Create a structure array and store data in its fields. Access the contents by name using array indexing and dot notation.
- Generate Field Names from Variables
Dynamically determine a structure field name at run time from a variable or expression.
- Ways to Organize Data in Structure Arrays
Consider ease of data access and system memory constraints when determining how to organize the data in a structure array.
- Memory Requirements for Structure Array
Structure arrays do not require contiguous memory, but their fields do. Instead of incrementally increasing the number of fields or number of elements in a field, preallocate memory for fields containing very large arrays.
- Cell vs. Structure Arrays
This example compares cell and structure arrays and shows how to store data in each type of array. Cell and structure arrays enable you to store data of different types and sizes.