FUNCTION REFERENCE

array2table

Table with one variable per column of an array.

Table with one variable per column of an array.

Syntax

T = array2table(A)

Syntax

T = array2table(A, 'VariableNames', names, 'RowNames', rows)

The variables are named after the input variable and the column number (array2table(M) gives M1, M2, ...), or Var1, Var2, ... for an expression.

Example

M = [1 2; 3 4]; T = array2table(M); T.M2   % [2; 4]

Example

T = array2table(magic(3), 'VariableNames', {'a', 'b', 'c'})   % 3x3 table

Differences from MATLAB: None known.

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