FIELDNAMES Fieldnames of a Structure

Section: Inspection Functions


Returns a cell array containing the names of the fields in a structure array. The syntax for its use is
   x = fieldnames(y)

where y is a structure array of object array. The result is a cell array, with one entry per field in y.


We define a simple structure array:
--> = 3; = 'hello';
--> x = fieldnames(y)

x =