Remove sample from
Delete a sample in a
timeseries and display its time samples and corresponding data.
tsin = timeseries((0:10:50)',(0:5)'); tsin.Time
ans = 6×1 0 1 2 3 4 5
ans = 6×1 0 10 20 30 40 50
Delete the last sample by referencing its index, which is 6.
tsout = delsample(tsin,'Index',6); tsout.Time
ans = 5×1 0 1 2 3 4
Alternatively, you can specify the time value 5 to remove the last sample of
tsout = delsample(tsin,'Value',5);
timeseries, specified as a scalar.
timeind— Time indices
Time indices, specified as a numeric scalar or vector.
timevals— Sample times
Sample times, specified as a numeric scalar or vector, or a cell array of date character vectors. Valid date character vectors can have the following forms: