Main Content

delsamplefromcollection

Delete sample from tscollection

Description

tscout = delsamplefromcollection(tscin,'Index',ind) deletes samples from a tscollection object. ind specifies the indices of the tscin time vector corresponding to the samples to delete.

example

tscout = delsamplefromcollection(tscin,'Value',timevals) deletes the samples corresponding to the time values in timeval.

Examples

collapse all

Create a tscollection object from two timeseries objects. Then, remove the fifth sample.

ts1 = timeseries([1.1 2.9 3.7 4.0 3.0]',1:5,...
                 'Name','Acceleration');
ts2 = timeseries([3.2 4.2 6.2 8.5 1.1]',1:5,...
                 'Name','Speed');
tscin = tscollection({ts1;ts2});
tscout = delsamplefromcollection(tscin,'Index',5)
Time Series Collection Object: unnamed

Time vector characteristics

      Start time            1 seconds
      End time              4 seconds

Member Time Series Objects:

      Acceleration
      Speed

Input Arguments

collapse all

Input tscollection, specified as a scalar.

Time vector indices, specified as a scalar or vector.

Sample times, specified as a numeric scalar or vector, or a cell array of date character vectors. Valid date character vectors and strings can have the following forms:

FormatExample
dd-mmm-yyyy HH:MM:SS01-Mar-2000 15:45:17
dd-mmm-yyyy01-Mar-2000
mm/dd/yy03/01/00
mm/dd03/01
HH:MM:SS15:45:17
HH:MM:SS PM3:45:17 PM
HH:MM15:45
HH:MM PM3:45 PM
mmm.dd,yyyy HH:MM:SSMar.01,2000 15:45:17
mmm.dd,yyyyMar.01,2000
mm/dd/yyyy03/01/2000

Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | cell

Version History

Introduced before R2006a