tscollection.resample
tscollection: tc = resample (tc, time)
tscollection: tc = resample (tc, time, method)
tscollection: tc = resample (tc, time, method, code)
Evaluate every member at new times.
tc = resample (tc, time) returns the collection
tc with every member evaluated at time by its own
interpolation method, as timeseries.resample evaluates a series:
at a time outside the collection the data is NaN, and a member
with quality codes gives each new time the code of the nearest sample.
MATLAB raises there for a member with quality codes.
tc = resample (tc, time, method) uses
method, 'linear' or 'zoh', for every member;
[] keeps each member’s own.
tc = resample (tc, time, method,
code) gives the quality code code to every new time the
collection did not already hold, in each member with quality codes; it
must be listed in the QualityInfo.Code of each of them. Members
without quality codes are resampled without it.
See also: timeseries.resample
Source Code: tscollection
Every member is evaluated at the new times by its own method.
a = timeseries ([0; 10; 20], [0; 1; 2], 'Name', 'a');
b = setinterpmethod (timeseries ([0; 10; 20], [0; 1; 2], 'Name', 'b'), ...
'zoh');
s = resample (tscollection ({a, b}), 0:0.5:2);
[s.Time, s.a.Data, s.b.Data]
ans =
0 0 0
0.5000 5.0000 0
1.0000 10.0000 10.0000
1.5000 15.0000 10.0000
2.0000 20.0000 20.0000