tscollection

Methods

Method Reference: tscollection.addts

tscollection: tc = addts (tc, ts)

tscollection: tc = addts (tc, {ts1, ts2, …})

tscollection: tc = addts (tc, data, name)

Add members to a collection.

tc = addts (tc, ts) adds the timeseries ts as the last member of tc, and tc = addts (tc, {ts1, ts2, …}) adds each series in the cell array in turn. Each must have the times of the collection, in the same units; a series with a TimeInfo.StartDate added to a collection without one loses its start date, with a warning, as in MATLAB, and the reverse is refused. A collection with no samples and no members takes the times of the first series. Each member is named as the constructor names it.

tc = addts (tc, data, name) adds a member name holding the samples data, a numeric or logical array of one sample per time of the collection, read against the time vector as the timeseries constructor reads it.

Names must be unique ignoring case: MATLAB refuses A beside a here, though settimeseriesnames allows it there. MATLAB also ignores a fourth argument, which is refused here.

See also: tscollection.removets, tscollection.settimeseriesnames

Source Code: tscollection

addts adds a series on the collection's times, or data with a name.

 tc = tscollection (timeseries ([1; 2; 3], [0; 1; 2], 'Name', 'a'));
 tc = addts (tc, timeseries ([4; 5; 6], [0; 1; 2], 'Name', 'b'));
 tc = addts (tc, [7; 8; 9], 'c');
 gettimeseriesnames (tc)
ans =
  1x3 cell array

    {'a'}    {'b'}    {'c'}