delsamplefromcollection
Removes samples from a tscollection object.
Category: Language Fundamentals > Data Types
Syntax
tsc2 = delsamplefromcollection(tsc, 'Index', n)
Removes the samples at the indices n from every member.
tsc2 = delsamplefromcollection(tsc, 'Value', t)
Removes the samples at the times t.
Description
A collection has a single common time vector, so a sample is removed from that vector and from the data of every member series at once. It is the collection counterpart of delsample.
Input arguments
tsc- tscollection object, a group of time series sharing one time vector.
n- Sample indices.
t- Time values.
Output arguments
tsc2- The collection with the samples removed.
Example
Dropping the middle sample
ts = timeseries([1 2 3]', [0 1 2]', 'Name', 'a');
tsc = tscollection(ts);
tsc2 = delsamplefromcollection(tsc, 'Index', 2);
tsc2.Time'
Output
ans = 1×2
0 2