Categories &

Functions List

Function Reference: struct2table

datatypes: tbl = struct2table (S)
datatypes: tbl = struct2table (S, Name, Value)

Convert a cell array to a table.

tbl = struct2table (S) converts a structure array S to the table tbl, where each field of the input structure becomes a variable in the output table. For a scalar structure with N fields, all of which have M rows, or an M×1 or 1×M structure array with N fields, the output is an M×N table.

tbl = array2table (S, Name, Value) specifies optional parameters for creating the table tbl with the following Name-Value paired arguments.

NameValue
'AsArray'A logical scalar specifying whether to treat a scalar input as a structure array, which allows the fields containing data of different sizes.
'RowNames'A cell array of character vectors or a string array defining the row names of tbl. The names must be unique but not necessarily valid variable names.
'DimensionNames'A cell array of character vectors or a string array defining the dimension names of tbl. The names must be unique and not in conflict with variable names. By default, dimension names are 'Row', 'Variables'.

See also: array2table, cell2table, table

Source Code: struct2table