tscollection

Methods

Method Reference: tscollection.getsampleusingtime

tscollection: tc2 = getsampleusingtime (tc, t)

tscollection: tc2 = getsampleusingtime (tc, t, 'AllowDuplicateTimes', tf)

tscollection: tc2 = getsampleusingtime (tc, t1, t2)

Return a collection of the samples at a time or between two times.

tc2 = getsampleusingtime (tc, t) returns the collection tc holding only the sample at time t. When several samples share that time the call is refused, unless 'AllowDuplicateTimes' is true, which returns them all.

tc2 = getsampleusingtime (tc, t1, t2) returns the samples from t1 to t2, both included.

The times are read as timeseries.getsampleusingtime reads them. No sample in range gives a collection with no samples and every member. The name and every member’s properties are kept; MATLAB names the result 'unnamed' and, when it is empty, drops every member.

See also: timeseries.getsampleusingtime

Source Code: tscollection

The samples between two times, both included, from every member.

 tc = tscollection ({timeseries((1:5)', 0:4, 'Name', 'a'), ...
                     timeseries((10:10:50)', 0:4, 'Name', 'b')});
 s = getsampleusingtime (tc, 1, 3);
 [s.Time, s.a.Data, s.b.Data]
ans =

    1    2   20
    2    3   30
    3    4   40