Next: , Up: API Alphabetically   [Contents]

8.2.1 array2table

Function: out = array2table (c)
Function: out = array2table (…, 'VariableNames', VariableNames)
Function: out = array2table (…, 'RowNames', RowNames)

Convert an array to a table.

Converts a 2-D array to a table, with columns in the array becoming variables in the output table. This is typically used on numeric arrays, but it can be applied to any type of array.

You may not want to use this on cell arrays, though, because you will end up with a table that has all its variables of type cell. If you use cell2table instead, columns of the cell array which can be condensed into primitive arrays will be. With array2table, they won’t be.

See also: cell2table, table, struct2table