cell2table

Syntax

Description

T = cell2table(C) converts
the contents of an m-by-n cell
array, C, to an m-by-n table, T.
Each variable in the table, T, is numeric, with
a data type double, or a cell array of character
vectors.

cell2table uses the input array name appended
with the column number for the variable names in the table. If these
names are not valid MATLAB® identifiers, cell2table uses
character vectors of the form 'Var1',...,'VarN' where N is
the number of columns in C.

Related Examples

Input Arguments

C — Input cell array2-D cell array

Input cell array, specified as a 2-D cell array.

If the cell contents have compatible sizes and types, then cell2table vertically
concatenates the contents of the cells in each column of C to
create each variable in T. If the cell contents
have different sizes or incompatible types, then the corresponding
variable in the table, T, is a column of cells.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments.
Name is the argument
name and Value is the corresponding
value. Name must appear
inside single quotes (' ').
You can specify several name and value pair
arguments in any order as Name1,Value1,...,NameN,ValueN.

Row names for T, specified as the comma-separated
pair consisting of 'RowNames' and a cell array
of character vectors that are nonempty and distinct. The number of
character vectors must equal the number of rows, size(C,1).

'VariableNames' — Variable names for Tcell array of character vectors

Variable names for T, specified as the comma-separated
pair consisting of 'VariableNames' and a cell array
of character vectors that are nonempty and distinct. The number of
character vectors must equal the number of variables, size(C,2).

Furthermore, the variable names must be valid MATLAB identifiers.
If valid MATLAB identifiers are not available for use as variable
names, MATLAB uses a cell array of N character
vectors of the form {'Var1' ... 'VarN'},
where N is the number of variables. You
can determine valid MATLAB variable names using the function isvarname.