Skip to Main Content Skip to Search
Product Documentation

removets - Remove timeseries objects from tscollection object

Syntax

tsc=removets(tsc,Name)

Description

tsc = removets(tsc,Name) removes one or more timeseries objects with the name specified in Name from the tscollection object tsc. Name can either be a string or a cell array of strings.

Examples

The following example shows how to remove a time series from a tscollection.

  1. Create two timeseries objects, ts1 and ts2.

    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');
    
  2. Create a tscollection object tsc, which includes ts1 and ts2.

    tsc=tscollection({ts1 ts2});
    
  3. To view the members of tsc, type the following at the MATLAB prompt:

    tsc
    

    The response is

    Time Series Collection Object: unnamed
    
    Time vector characteristics
    
          Start time            1 seconds
          End time              5 seconds
    
    Member Time Series Objects:
    
          acceleration
          speed
    

    The members of tsc are listed by name at the bottom: acceleration and speed. These are the Name properties of ts1 and ts2, respectively.

  4. Remove ts2 from tsc.

    tsc=removets(tsc,'speed');
    
  5. To view the current members of tsc, type the following at the MATLAB prompt:

    tsc
    

    The response is

    Time Series Collection Object: unnamed
    
    Time vector characteristics
    
          Start time            1 seconds
          End time              5 seconds
    
    Member Time Series Objects:
          acceleration
    

The remaining member of tsc is acceleration. The timeseries speed has been removed.

See Also

addts | tscollection

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS