timetable

Methods

Method Reference: timetable.timetable

timetable: tt = timetable (rowTimes, var1, …, varN)
timetable: tt = timetable (var1, …, varN, 'RowTimes', rowTimes)
timetable: tt = timetable (var1, …, varN, 'TimeStep', dt)
timetable: tt = timetable (var1, …, varN, 'SampleRate', fs)
timetable: tt = timetable (…, 'StartTime', t0)
timetable: tt = timetable ('Size', sz, 'VariableTypes', varTypes, …)
timetable: tt = timetable (…, 'VariableNames', varNames)
timetable: tt = timetable (…, 'DimensionNames', dimNames)

Create a new timetable.

tt = timetable (rowTimes, var1, …, varN) creates a timetable whose rows are labelled by rowTimes, a datetime or duration vector with one element for each row, and whose variables are the remaining input arguments. Variable names are taken from the names of the input variables, and the row dimension is named after rowTimes itself.

tt = timetable (var1, …, varN, 'RowTimes', rowTimes) does the same with the row times given as a Name-Value pair, in which case the row dimension is named 'Time'.

tt = timetable (var1, …, varN, 'TimeStep', dt) generates the row times instead of taking them, starting at t0 and stepping by dt, a duration or calendarDuration scalar. A calendar step requires a datetime start time.

tt = timetable (var1, …, varN, 'SampleRate', fs) generates them at fs rows per second, which is the same as a TimeStep of seconds (1 / fs).

tt = timetable (…, 'StartTime', t0) sets the time of the first row for either of the two generating forms. It defaults to a zero duration in the units of the step, so that a timetable generated without one is keyed by elapsed time rather than by date.

tt = timetable ('Size', sz, 'VariableTypes', varTypes, …) creates a preallocated timetable of the given size, filled with the default value of each type. sz must be a two-element numeric array giving the number of rows and of variables. The row times must still be supplied, by any one of 'RowTimes', 'TimeStep' or 'SampleRate'.

tt = timetable (…, 'VariableNames', varNames) specifies the variable names to use, as a cell array of character vectors or a string array with one nonempty and unique element per variable.

tt = timetable (…, 'DimensionNames', dimNames) specifies the two dimension names to use, naming the rows and the variables.

tt = timetable () returns an empty timetable with 0 rows and 0 variables.

See also: table.table2timetable, array2timetable, isregular

Source Code: timetable