Main Content

Time Series Objects

Create, modify, and analyze timeseries objects containing time-dependent data

A timeseries object contains data and time information within its properties that describes a dynamic process. You can use timeseries object functions to create, modify, and analyze the behavior of a time series.

Consider using timetables instead of timeseries objects, where you can store time-stamped data as column-oriented data variables. Additionally, you can use time-specific functions to align, combine, and perform calculations with one or more timetables.


expand all

timeseriesCreate timeseries object
ts2timetableConvert timeseries objects to timetable
addeventAdd event to timeseries
addsampleAdd data sample to timeseries object
appendConcatenate timeseries objects in time
deleventRemove event from timeseries
delsampleRemove sample from timeseries object
detrendSubtract mean or best-fit line from timeseries object
filterModify frequency content of timeseries objects
idealfiltertimeseries ideal filter
plotPlot timeseries
resampleResample timeseries time vector
setSet timeseries properties
setabstimeSet timeseries times as date character vectors
setinterpmethodSet default interpolation method for timeseries object
setuniformtimeModify uniform timeseries time vector
synchronizeSynchronize and resample two timeseries objects using common time vector
getQuery timeseries properties
getabstimeConvert timeseries time vector to cell array
getdatasamplesAccess timeseries data samples
getdatasamplesizetimeseries data sample size
getinterpmethodtimeseries interpolation method
getqualitydesctimeseries data quality
getsamplesSubset of timeseries
getsampleusingtimeSubset of timeseries data
gettsafterateventCreate timeseries at or after event
gettsaftereventCreate timeseries after event
gettsateventCreate timeseries at event
gettsbeforeateventCreate timeseries at or before event
gettsbeforeeventCreate timeseries before event
gettsbetweeneventsCreate timeseries between events
iqrInterquartile range of timeseries data
maxMaximum of timeseries data
meanMean of timeseries data
medianMedian of timeseries data
minMinimum of timeseries data
stdStandard deviation of timeseries data
sumSum of timeseries data
varVariance of timeseries data


What Are Time Series?

Time series are data vectors sampled linearly over time that represent the evolution of a dynamic process.

Time Series Objects and Collections

There are two types of time series objects in MATLAB®, a timeseries object and a tscollection object.