timeseries2timetable
Converts timeseries objects to a timetable.
Category: Language Fundamentals > Data Types
Syntax
TT = timeseries2timetable(ts)
Returns a timetable with the samples and times of ts.
TT = timeseries2timetable(ts1, ts2, ...)
Combines several series into one timetable.
Description
Numeric time vectors in seconds become duration row times, so a series sampled at 0, 1, 2 becomes the times 0 sec, 1 sec, 2 sec. The data variable is named Data.
The result can be used with synchronize, retime and indexing by time.
Input arguments
ts- timeseries object (or several).
Output arguments
TT- Timetable whose row times are the times of the series (as durations) and whose variable is the data.
Example
Series to timetable
ts = timeseries([1 2 3]', [0 1 2]);
timeseries2timetable(ts)
Output
ans = 3×1 timetable
Time Data
_____ ____
0 sec 1
1 sec 2
2 sec 3