Fields in a Structure

19 views (last 30 days)
Preetam Pal
Preetam Pal on 16 Aug 2015
Answered: Shivam on 30 Jul 2022
How can I fetch the list of fields in a structure? Regards, Preetam

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 16 Aug 2015
Use fieldnames

More Answers (1)

Shivam
Shivam on 30 Jul 2022
You can fetch the fields of a structure S using fieldname this way.
fields = fieldnames(S)
It returns the field names of the structure array S in a cell array.

Categories

Find more on Structures in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!