fieldnames
List of field names in a structure.
Syntax
Section titled “Syntax”names = fieldnames(s)names = fieldnames(s, full)Description
Section titled “Description”Returns a cell array of field-name strings for the structure s. With full = true, includes inherited fields when s is an object instance.
Examples
Section titled “Examples”s.a = 1; s.b = 'foo';fieldnames(s) % {'a'; 'b'}