<< table2cell | Tables | tail >> |
S = table2struct(T) |
S = table2struct(T, "ToScalar", true) |
a table object
Structure.
S = table2struct(T) converts the table T into a structure array S, where each variable in T is represented as a field in S.
If T is an m-by-n table, S will be an m-by-1 structure array with n fields.
the output S will not contain any table properties from T.Properties.
S = table2struct(T, "ToScalar", true) converts the table T into a scalar structure S, where each variable in T becomes a field in S.
If T is an m-by-n table, S will contain n fields, and each field will have m rows.
Names = {'John'; 'Alice'; 'Bob'; 'Diana'};
Age = [28; 34; 22; 30];
Height = [175; 160; 180; 165];
Weight = [70; 55; 80; 60];
T = table(Names, Age, Height, Weight)
S1 = table2struct(T)
S1 = table2struct(T, "ToScalar", true)
Version | Description |
---|---|
1.8.0 | initial version |
Allan CORNET