FUNCTION REFERENCE

table2struct

Struct array of the table's rows.

Struct array of the table's rows.

Syntax

S = table2struct(T)

Syntax

S = table2struct(T, 'ToScalar', true)

S is height-by-1 with one field per variable; 'ToScalar', true gives one struct whose fields are the whole variables.

Example

S = table2struct(table([1; 2], 'VariableNames', {'x'})); S(2).x   % 2

Example

s = table2struct(table([1; 2], 'VariableNames', {'x'}), 'ToScalar', true)   % s.x = [1; 2]

Differences from MATLAB: Row names are not returned.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.