timeseries

Methods

Method Reference: timeseries.delsample

timeseries: ts = delsample (ts, 'Index', ind)

timeseries: ts = delsample (ts, 'Value', time)

Remove samples from a series.

ts = delsample (ts, 'Index', ind) removes the samples ind, a vector of positive integers not exceeding Length; repeats are allowed and [] removes nothing. A logical mask is refused, as in MATLAB.

ts = delsample (ts, 'Value', time) removes every sample at each of the times time; a time no sample has removes nothing. For a series with no TimeInfo.StartDate the times are numbers in its units; for one with a start date they may also be dates as text, or a datetime.

The option names are matched in any case. Every property but the samples is kept. MATLAB turns quality codes held per data element of three-dimensional data into a vector here; they lose the slice of each removed sample, as the data does.

See also: timeseries.addsample, timeseries.getsamples

Source Code: timeseries

Samples are removed by position with 'Index', or by time with 'Value', which removes every sample at that time.

 ts = timeseries ([10; 20; 30; 40], [0; 1; 1; 2]);
 s = delsample (ts, 'Index', [1, 4]);
 [s.Time, s.Data]
ans =

    1   20
    1   30
 s = delsample (ts, 'Value', 1);
 [s.Time, s.Data]
ans =

    0   10
    2   40