Get fieldnames from array of structs and convert to table

Convert nested array of structs to flatten struct or table. Filter all variable by using the class, type or level

You are now following this Submission

[fields,tab] = fieldnamesAll(s,varargin)
FIELDNAMESALL returns all field names from a deeply nested array of "structs"
This function is an improved version of MATLAB built-in function fieldnames

s1 = flattenStruct(s,varargin)
FLATTENSTRUCT Convert nested struct to flatten struct
The function also works with array of structs and deeply nested structs.

tab = struct2tableAll(s,varargin)
STRUCT2TABLEALL Convert array of structs and array of nested structs to table
This function is an improved version of MATLAB built-in function struct2table

Cite As

Markus Uhlending (2026). Get fieldnames from array of structs and convert to table (https://se.mathworks.com/matlabcentral/fileexchange/76718-get-fieldnames-from-array-of-structs-and-convert-to-table), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with R2019b and later releases

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.1

Change Description

1.0.0