fieldnames
Returns a cell array of strings with the names of the fields in the specified struct.
Syntax
R = fieldnames(a)
Inputs
- a
 - Struct.
 
Outputs
- R
 - Cell array containing the field names of a. The field names are sorted alphabetically.
 
Example
Simple fieldnames example.
a.name='Bob';
a.age=37;
R = fieldnames(a)
      R = 
{
[1,1] age
[2,1] name
}