table

Methods

Method Reference: table.table2timetable

table: tt = table2timetable (tbl)
table: tt = table2timetable (tbl, 'RowTimes', rowTimes)
table: tt = table2timetable (tbl, 'TimeStep', dt)
table: tt = table2timetable (tbl, 'SampleRate', fs)
table: tt = table2timetable (…, 'StartTime', t0)

Convert a table to a timetable.

tt = table2timetable (tbl) converts the table tbl to a timetable, taking its row times from the first variable that is a datetime or a duration. That variable stops being a variable and becomes the row times, and the row dimension is named after it. A table with no such variable cannot be converted this way.

tt = table2timetable (tbl, 'RowTimes', rowTimes) says which times to use. rowTimes may be a datetime or duration vector with one element per row, in which case every variable of tbl is kept and the row dimension is named 'Time'; or it may name one of the variables, by name or by index, which is then taken as the row times exactly as above.

tt = table2timetable (tbl, 'TimeStep', dt) and tt = table2timetable (tbl, 'SampleRate', fs) generate the row times instead, keeping every variable. 'StartTime' sets the time of the first row for either, and the row dimension is named 'Time'.

The row names of tbl, if it has any, are not carried over: a timetable labels its rows by time and by nothing else.

See also: timetable.timetable2table, array2timetable, timetable, table

Source Code: table