Skip to Main Content Skip to Search
Product Documentation

delsample - Class: timeseries

Remove sample from timeseries object

Syntax

ts1 = delsample(ts,Name,Value)

Description

ts1 = delsample(ts,Name,Value) deletes samples from the timeseries object ts based on the specified Name,Value pair arguments.

Input Arguments

ts

A timeseries object.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Index'

The indices of the time vector that correspond to the samples you want to delete.

'Value'

The time values that correspond to the samples you want to delete.

Output Arguments

ts1

The timeseries object that results from removing the specified samples.

Examples

Create a timeseries object, and then remove samples:

ts = timeseries(rand(5,1),[10 20 30 40 50]);

% Remove data sample at time index 1

ts1 = delsample(ts,'Index', 1)

% Remove data sample at time value 20:

ts2 = delsample(ts,'Value', [20])

See Also

set | timeseries

  


» Learn more
» Download free kit
» Get trial software

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