Skip to content

array2table

Convert a matrix to a table.

T = array2table(A)
T = array2table(A, 'VariableNames', {'name1', ...})

Each column of A becomes one column variable in the table. Variable names default to 'A_1', 'A_2', … unless 'VariableNames' is provided.

array2table(magic(3))
array2table([1 2; 3 4], 'VariableNames', {'x', 'y'})
  • table2array — Convert a table to a matrix.
  • table — Create a table — a heterogeneous tabular data container.
  • cell2table — Convert a cell array to a table.