tscollection
Groups several time series that share a time vector (legacy object).
Category: Language Fundamentals > Data Types
Syntax
tsc = tscollection(ts_cell)
Creates a collection from a cell array of timeseries objects.
Description
A tscollection keeps several signals aligned. The members are reached as properties named after the series, so a series named A is tsc.A, and its samples are tsc.A.Data. tsc.Time holds the shared time vector.
It is retained for compatibility; a timetable with several variables is the current way to store aligned signals, and timeseries2timetable converts a series.
Input arguments
ts_cell- Cell array of timeseries objects with the same times. Each series needs its own name.
Output arguments
tsc- Collection with the common times in
Timeand one member per series, reached by its name.
Example
Two aligned signals
ts1 = timeseries([1;2;3], [0;1;2], 'Name', 'A');
ts2 = timeseries([4;5;6], [0;1;2], 'Name', 'B');
tsc = tscollection({ts1, ts2});
tsc.Time'
tsc.A.Data'
tsc.B.Data'
Output
ans = 1×3
0 1 2
ans = 1×3
1 2 3
ans = 1×3
4 5 6