Ways to Organize Data in Structure Arrays
There are at least two ways you can organize data in a structure array: plane organization
and element-by-element organization. The method that best fits your data depends on
how you plan to access the data, and, for very large data sets, whether you have system
memory constraints.
Plane organization allows easier access to all values within a field. Element-by-element
organization allows easier access to all information related to a single element or record.
The following sections include an example of each type of organization:
- “Plane Organization” on page 11-18
- “Element-by-Element Organization” on page 11-20
When you create a structure array, MATLAB stores information about each element and
field in the array header. As a result, structures with more elements and fields require
more memory than simpler structures that contain the same data. For more information
on memory requirements for arrays, see “How MATLAB Allocates Memory” on page 29-
12.
Plane Organization
Consider an RGB image with three arrays corresponding to color intensity values.
11 Structures