Section: Elementary Functions
y = getfield(x,'fieldname')
and is equivalent to y = x.fieldname where x is a scalar (1 x 1)
structure. If x is not a scalar structure, then y is the
first value, i.e., it is equivalent to y = x(1).fieldname.
The second form allows you to specify a subindex into a
structure array, and has the following syntax
y = getfield(x, {m,n}, 'fieldname')
and is equivalent to y = x(m,n).fieldname. You can chain multiple
references together using this syntax.