Hello, I'm currently trying to store all fields and its containing subfields in a cell array and encounter problems using 'fieldnames'. I thought it would be the easiest way to write recursive code to solve this... Lets say I have a fields with subfields as follows: A.b.c.d A.b.c.a A.b.d.a A.b.d.b and so on. In this case the main field A has a couple of subfields and some of those have their subfields. Is there an easy way to extract all fields with its subfields? I tried to do it using 'getfield', 'fieldnames', 'strsplit' and 'strcat' but did not really succeed.