Subset of time series samples using subscripted index array
ts1 = getsamples(ts, i)
The timeseries object from which you want to exact samples.
A subscripted index array that specifies the time value or values for which you want to extract the corresponding samples.
The timeseries object that results from extracting the samples corresponding to the time value or values ts.time(i) .
After creating a timeseries object, ts, extract the data samples at times 2 and 3 into a new timeseries object, ts1:
ts = timeseries(rand(5,1),[1 2 3 4 5]); ts1 = getdatasamples(ts, ts.time([2 3]))