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
For more information, see Create Structure Array or watch Introducing
Structures and Cell Arrays.
|Field names of structure, or public fields of COM or Java object|
|Field of structure array|
|Determine whether input is structure array field|
|Determine whether input is structure array|
|Order fields of structure array|
|Remove fields from structure|
|Assign values 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|
This example shows how to create a structure array and access data within in.
This example shows how to access the contents of a structure array.
Concatenate structure arrays using the
To concatenate structures, they must have the same set of fields,
but the fields do not need to contain the same sizes or types of data.
Dynamically determine a structure field name at run time from a variable or expression.
Index into a structure that is nested within another structure.
Access and process data from multiple elements of a nonscalar structure array.
This example compares cell and structure arrays, and shows how to store data in each type of array. Both cell and structure arrays allow you to store data of different types and sizes.
Consider how you plan to access data and system memory constraints when determining how to organize the data in a structure array.
Structure arrays do not require contiguous memory. However, each field requires contiguous memory, as does the header that describes the array.