Add timeseries
object to tscollection
object
tsc = addts(tsc,ts)
tsc = addts(tsc,ts)
tsc = addts(tsc,ts,Name)
tsc = addts(tsc,Data,Name)
tsc = addts(tsc,ts)
adds
the timeseries
object ts to tscollection
object
tsc.
tsc = addts(tsc,ts)
adds
a cell array of timeseries
objects ts to the tscollection
tsc.
tsc = addts(tsc,ts,Name)
adds
a cell array of timeseries
objects ts to tscollection
tsc.
Name is a cell array of strings that gives the names of the timeseries
objects
in ts
.
tsc = addts(tsc,Data,Name)
creates
a new timeseries
object from Data with the name
Name and adds it to the tscollection
object tsc.
Data is a numerical array and Name is a string.
The following example shows how to add a time series to a time-series collection:
Create two timeseries
objects, ts1
and ts2
.
ts1 = timeseries([1.1 2.9 3.7 4.0 3.0],1:5,... 'name','acceleration'); ts2 = timeseries([3.2 4.2 6.2 8.5 1.1],1:5,... 'name','speed');
Create a time-series collection tsc
,
which includes ts1
.
tsc = tscollection(ts1);
Add ts2
to the tsc
collection.
tsc = addts(tsc, ts2);
To view the members of tsc
,
type
tsc
at the MATLAB® prompt. the response is
Time Series Collection Object: unnamed Time vector characteristics Start time 1 seconds End time 5 seconds Member Time Series Objects: acceleration speed
The members of tsc
are listed by name at
the bottom: acceleration
and speed
.
These are the Name
properties of the timeseries
objects ts1
and ts2
,
respectively.