removets

Removes a time series from a tscollection.

Category: Language Fundamentals > Data Types

Syntax

tsc = removets(tsc, name)

Removes the member time series called name.

Description

A tscollection groups several timeseries objects that share one time vector. removets drops members by name and leaves the others and the shared time vector untouched. Use gettimeseriesnames to list what remains.

Input arguments

tsc
A tscollection object.
name
Name or cell array of names of the series to remove.

Output arguments

tsc
The collection without those series.

Example

ts1 = timeseries([1 2 3]', [0 1 2], 'Name', 'a');
ts2 = timeseries([4 5 6]', [0 1 2], 'Name', 'b');
tsc = tscollection({ts1, ts2});
tsc = removets(tsc, 'a');
gettimeseriesnames(tsc)
Output
ans = 1×1 cell

    {'b'}

See also

tscollection addts gettimeseriesnames settimeseriesnames timeseries