%% Timetable from Array of timeseries Objects
% Create an array of timeseries objects. Use the same vector of sample times but give the time series different names. Create different arrays of data values by using the rand function.

ts1 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_1");
ts2 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_2");
ts3 = timeseries(rand(5,1),[0 10 20 30 40],"Name","Series_3");
ts = [ts1 ts2 ts3]

%
% Combine data from all the timeseries objects into one timetable. Each time series in the array contributes a variable to the timetable.

TT = timeseries2timetable(ts)

%
% Copyright 2020-2021 The MathWorks, Inc.