getsamples
Class:timeseries
Subset of time series samples using subscripted index array
Syntax
ts1 = getsamples(ts, i)
Description
returns a newts1
= getsamples(ts
, i)timeseries
object by extracting samples fromtimeseries
ts
corresponding to the time or times indicated by the subscripted index array,i
.
Input Arguments
|
The |
|
An index array corresponding to the times to extract. |
Output Arguments
|
The |
Examples
After creating atimeseries
object,ts
, extract the data samples at times 2 and 3 into a newtimeseries
object,ts1
:
ts = timeseries(rand(5,1),[1 2 3 4 5]); ts1 = getsamples(ts, ts.time([2 3]))
See Also
Was this topic helpful?