MATLAB: How to concatenate tables stored in a structure

concatenateMATLABstructurestable

I have a structure where tables with same variable names are stored. I want to concatenate all these tables in one big table.
say i have struct S
struct with fields:
T1: [34113×16 table]
T2: [34133×16 table]
T3: [34059×16 table]
T4: [33297×16 table]
T5: [34150×16 table]
I can do:
T=cat(1,T1,T2,T3,T4,T5)
but want to do it with listing struct fields and concatenate.

Best Answer

As Stephen commented, the initial designed is flawed. numbered variables and field names should always be replaced by a single container.
With a structure it's easily fixed by converting the structure into a cell array:
C = struct2cell(S);
vertcat(C{:}) %vertically concatenate all the fields of S