Documentation Center

  • Trial Software
  • Product Updates

getdatasamples

Class: timeseries

Returns subset of time series samples using subscripted index array

Syntax

datasamples = getdatasamples(ts, i)

Description

datasamples = getdatasamples(ts, i) returns an array corresponding to the samples indicated by the array, i.

Input Arguments

ts

The timeseries object from which you want to exact samples.

i

An array of linear indices or logical values that specifies the time value or values for which you want to extract the corresponding samples.

Output Arguments

datasamples

The array that results from extracting the samples corresponding to the time value or values, ts.time(i).

Examples

After creating a timeseries object, ts, extract the second and third data samples into an array:

ts = timeseries(rand(5,1),[1 2 3 4 5]);
samples = getdatasamples(ts, [2 3])

See Also

| |

Was this topic helpful?