| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
Example: Time Series Objects and Methods |
MATLAB time series objects are of two types:
timeseries — Stores data and time values, as well as the metadata information that includes units, events, data quality, and interpolation method
tscollection — Stores a collection of timeseries objects that share a common time vector, convenient for performing operations on synchronized time series with different units
This section discusses the following topics:
Using time series constructors to instantiate time series classes
Modifying object properties using set methods or dot notation
Calling time series functions and methods
To get a quick overview of programming with timeseries and tscollection objects, follow the steps in Example: Time Series Objects and Methods.
If you prefer to work with a graphical user interface (GUI), use MATLAB Time Series Tools to work with time series data. For more information about Time Series Tools, see Example: Time Series Tools.
Note If you are new to programming with timeseries and tscollection objects, you might want to start by working with Time Series Tools and enabling the Record M-Code feature. This generates reusable M-code based on the operations you perform in the GUI. For more information, see Generating Reusable M-Code. |
To properly understand the description of timeseries object properties and methods in this documentation, it is important to clarify some terms related to storing data in a timeseries object—the difference between a data value and a data sample.
A data value is a single, scalar value recorded at a specific time. A data sample consists of one or more values associated with a specific time in the timeseries object. The number of data samples in a time series is the same as the length of the time vector.
For example, consider data that consists of three sensor signals: two signals represent the position of an object in meters, and the third represents its velocity in meters/second.
To enter the data matrix, type the following at the MATLAB prompt:
x = [-0.2 -0.3 13;
-0.1 -0.4 15;
NaN 2.8 17;
0.5 0.3 NaN;
-0.3 -0.1 15]
The NaN value represents a missing data value. MATLAB displays the following 5-by-3 matrix:
x=
-0.2000 -0.3000 13.0000
-0.1000 -0.4000 15.0000
NaN 2.8000 17.0000
0.5000 0.3000 NaN
-0.3000 -0.1000 15.0000The first two columns of x contain quantities with the same units and you can create a multivariate timeseries object to store these two time series. For more information about creating timeseries objects, see Time Series Constructor Syntax. The following command creates a timeseries object ts_pos to store the position values:
ts_pos = timeseries(x(:,1:2), 1:5, 'name', 'Position')
MATLAB responds by displaying the following properties of ts_pos:
Time Series Object: Position
Time vector characteristics
Length 5
Start time 1 seconds
End time 5 seconds
Data characteristics
Interpolation method linear
Size [5 2]
Data type doubleThe Length of the time vector, which is 5 in this example, equals the number of data samples in the timeseries object. Find the size of the data sample in ts_pos by typing the following at the MATLAB prompt:
getdatasamplesize(ts_pos)
ans =
1 2Similarly, you can create a second timeseries object to store the velocity data:
ts_vel = timeseries(x(:,3), 1:5, 'name', 'Velocity');
Find the size of each data sample in ts_vel by typing the following:
getdatasamplesize(ts_vel)
ans =
1 1Notice that ts_vel has one data value in each data sample and ts_pos has two data values in each data sample.
Note In general, when the time series data is an M-by-N-by-P-by-... multidimensional array with M samples, the size of each data sample is N-by-P-by-... . |
If you want to perform operations on the ts_pos and ts_vel timeseries objects while keeping them synchronized, group them in a time series collection. For more information, see Time Series Collection Constructor Syntax.
This portion of the example illustrates how to create several timeseries objects from an array. For more information about the timeseries object, see Time Series Constructor.
The sample data provided with this example consists of a 24-by-3 matrix of double values, where each column represents the hourly traffic counts at three town intersections.
This adds the variable count to the MATLAB workspace:
%% Import the sample data load count.dat
To view the count matrix, type
count
MATLAB displays the following 24-by-3 matrix:
11 11 9 7 13 11 14 17 20 11 13 9 43 51 69 38 46 76 61 132 186 75 135 180 38 88 115 28 36 55 12 12 14 18 27 30 18 19 29 17 15 18 19 36 48 32 47 10 42 65 92 57 66 151 44 55 90 114 145 257 35 58 68 11 12 15 13 9 15 10 9 7
Create three timeseries objects to store the data collected at each intersection:
count1 = timeseries(count(:,1), 1:24,'name', 'intersection1'); count2 = timeseries(count(:,2), 1:24,'name', 'intersection2'); count3 = timeseries(count(:,3), 1:24,'name', 'intersection3');
Note In the above construction, timeseries objects have both a variable name (e.g., count1) and an internal object name (e.g., intersection1). The variable name is used with MATLAB functions. The object name is a property of the object, accessed with object methods. For more information on timeseries object properties and methods, see Time Series Properties and Time Series Methods. |
Each time series has a time vector in units of seconds, starting at 1 second and increasing up to 24 seconds in 1-second increments. The software assumes this increment when you do not explicitly specify one. You will change the time units to hours in Modifying Time Series Units and Interpolation Method.
Note If you want to create a timeseries object that groups the three data columns in count, use the following syntax: count_ts = timeseries(count, 1:24,'name','traffic_counts') This is useful when all time series have the same units and you want to keep them synchronized during calculations. |
After creating a timeseries object, as described in Creating Time Series Objects, you can view it in either the Variable Editor or Time Series Tools.
To view a timeseries object like count1 in the Variable Editor, use any one of several methods:
Type open('count1') at the command prompt.
Select count1 in the Workspace
Browser and click the Open selection button
.
Double-click count1 in the Workspace Browser.
Right-click count1 in the Workspace Browser and select Open selection from the context menu.
To view count1 in Time Series Tools, right-click count1 in the Workspace Browser and choose Open in Time Series Tools from the context menu.
When a timeseries object is opened in either the Variable Editor or Time Series Tools, it is displayed with the Time Series Editor:

For information on using the Time Series Editor, see Editing Data and Time.
After creating a timeseries object, as described in Creating Time Series Objects, you can modify its units and interpolation method using dot notation.
To view the current properties of count1, type
get(count1)
MATLAB responds by displaying the current property values of the count1 timeseries object:
Events: [] Name: 'intersection1' Data: [24x1 double] DataInfo: [1x1 tsdata.datametadata] Time: [24x1 double] TimeInfo: [1x1 tsdata.timemetadata] Quality: [] QualityInfo: [1x1 tsdata.qualmetadata] IsTimeFirst: true TreatNaNasMissing: true
To view the current DataInfo properties, use dot notation:
count1.DataInfo
Change the data units and the default interpolation method for count1, as follows:
count1.DataInfo.Units = 'cars';
% Specify new data units
count1.DataInfo.Interpolation = tsdata.interpolation('zoh');
% Set the interpolation method to zero-order hold
To verify that the DataInfo properties have been modified, type
count1.DataInfo
MATLAB confirms the change by displaying
Time Series Data Meta Data Object
Unit cars
Interpolation Method zoh
Modify the time units to be 'hours' for the three time series:
count1.TimeInfo.Units = 'hours'; count2.TimeInfo.Units = 'hours'; count3.TimeInfo.Units = 'hours';
This portion of the example illustrates how to define events for a timeseries object by using the tsdata.event auxiliary object. Events mark the data at specific times. When you plot the data, event markers are displayed on the plot. Events also provide a convenient way to synchronize multiple time series.
Use the following syntax to add two events to the data that mark the times of the AM commute and PM commute:
%% Construct and add the first event to all time series
e1 = tsdata.event('AMCommute',8);
% Construct the first event at 8 AM
e1.Units = 'hours'; % Specify the time units of the time
count1 = addevent(count1,e1); % Add the event to count1
count2 = addevent(count2,e1); % Add the event to count2
count3 = addevent(count3,e1); % Add the event to count3
%% Construct and add the second event to all time series
e2 = tsdata.event('PMCommute',18);
% Construct the first event at 6 PM
e2.Units = 'hours'; % Specify the time units of the time
count1 = addevent(count1,e2); % Add the event to count1
count2 = addevent(count2,e2); % Add the event to count2
count3 = addevent(count3,e2); % Add the event to count3
This portion of the example illustrates how to create a tscollection object. Each individual time series in a collection is called a member. For more information about the tscollection object, see Time Series Collection Constructor.
Note Typically, you use the tscollection object to group synchronized time series that have different units. In this simple example, all time series have the same units and the tscollection object does not provide an advantage over grouping the three time series in a single timeseries object. For an example of how to group several time series in one timeseries object, see Creating Time Series Objects. |
Use the following syntax to create a tscollection object named count_coll and use the constructor syntax to immediately add two of the three time series currently in the MATLAB workspace (you will add the third time series later):
tsc = tscollection({count1 count2},'name', 'count_coll')
MATLAB responds with
Time Series Collection Object: count_coll
Time vector characteristics
Start time 1 hours
End time 24 hours
Member Time Series Objects:
intersection1
intersection2
Notice that the Name property of the timeseries objects is used to name the collection members as intersection1 and intersection2.
Add the third timeseries object in the workspace to the tscollection by using the following syntax:
tsc = addts(tsc, count3)
All three members in the collection are listed:
Time Series Collection Object: count_coll
Time vector characteristics
Start time 1 hours
End time 24 hours
Member Time Series Objects:
intersection1
intersection2
intersection3
This portion of the example illustrates how to resample each member in a tscollection using a new time vector. The resampling operation is used to either select existing data at specific time values, or to interpolate data at finer intervals. If the new time vector contains time values that did not exist in the previous time vector, the new data values are calculated using the default interpolation method you associated with the time series.
To resample the time series to include data values every 2 hours instead of every hour and save it as a new tscollection object, enter the following syntax:
tsc1 = resample(tsc,1:2:24)
In some cases you might need a finer sampling of information than you currently have and it is reasonable to obtain it by interpolating data values. For example, the following syntax interpolates values at each half-hour mark:
tsc1 = resample(tsc,1:0.5:24)
To add values at each half-hour mark, the default interpolation method of a time series is used. For example, the new data points in intersection1 are calculated by using the zero-order hold interpolation method, which holds the value of the previous sample constant. You set the interpolation method for intersection1 as described in Modifying Time Series Units and Interpolation Method.
The new data points in intersection2 and intersection3 are calculated using linear interpolation, which is the default method.
This portion of the example illustrates how to add a data sample to a tscollection.
You can use the following syntax to add a data sample to the intersection1 collection member at 3.25 hours (i.e., 15 minutes after the hour):
tsc1 = addsampletocollection(tsc1,'time',3.25,...
'intersection1',5)
There are three members in the tsc1 collection, and adding a data sample to one member adds a data sample to the other two members at 3.25 hours. However, because you did not specify the data values for intersection2 and intersection3 in the new sample, the missing values are represented by NaNs for these members. To learn how to remove or interpolate missing data values, see Removing Missing Data and Interpolating Missing Data.
tsc1 Data from 2.0 to 3.5 Hours
Hours | Intersection 1 | Intersection 2 | Intersection 3 |
|---|---|---|---|
2.0 | 7 | 13 | 11 |
2.5 | 7 | 15 | 15.5 |
3.0 | 14 | 17 | 20 |
3.25 | 5 | NaN | NaN |
3.5 | 14 | 15 | 14.5 |
To view all intersection1 data (including the new sample at 3.25 hours), type
tsc1.intersection1
Similarly, to view all intersection2 data (including the new sample at 3.25 hours containing a NaN value), type
tsc1.intersection2
Missing data in a time series are represented by NaNs. This portion of the example illustrates how to either remove the missing data or interpolate it by using the interpolation method you specified for that time series. In Adding a Data Sample to a Time Series Collection Object, you added a new data sample to the tsc1 collection at 3.25 hours.
There are three members in the tsc1 collection, and adding a data sample to one member adds a data sample to the other two members at 3.25 hours. However, because you did not specify the data values for the intersection2 and intersection3 members at 3.25 hours, they currently contain missing values that are represented by NaNs.
Removing Missing Data. You can use the following syntax to find and remove the data samples containing NaN values in the tsc1 collection:
tsc1 = delsamplefromcollection(tsc1,'index',...
find(isnan(tsc1.intersection2.Data)));
This command searches one tscollection member at a time—in this case, intersection2. When a missing value is located in intersection2, the data at that time is removed from all members of the tscollection.
Note You can use the following dot-notation syntax to access the Data property of the intersection2 member in the tsc1 collection: tsc1.intersection2.Data For a complete list of timeseries properties, see Time Series Properties. |
Interpolating Missing Data. For the sake of this example, you must reintroduce NaN values in intersection2 and intersection3 (which you removed):
tsc1 = addsampletocollection(tsc1,'time',3.25,...
'intersection1',5);
To interpolate the missing values in tsc1 using the current time vector (tsc1.Time), type the following syntax:
tsc1 = resample(tsc1,tsc1.Time)
This replaces the NaN values in intersection2 and intersection3 by using linear interpolation—the default interpolation method for these time series.
Note Dot notation tsc1.Time is used to access the Time property of the tsc1 collection. For a complete list of tscollection properties, see Time Series Collection Properties. |
To view intersection2 data after interpolation, for example, type
tsc1.intersection2
New tsc1 Data from 2.0 to 3.5 Hours
Hours | Intersection 1 | Intersection 2 | Intersection 3 |
|---|---|---|---|
2.0 | 7 | 13 | 11 |
2.5 | 7 | 15 | 15.5 |
3.0 | 14 | 17 | 20 |
3.25 | 5 | 16 | 17.3 |
3.5 | 14 | 15 | 14.5 |
To remove the intersection3 time series from the tscollection object tsc1, type:
tsc1 = removets(tsc1,'intersection3')
Two time series as members in the collection are now listed:
Time Series Collection Object: count_coll
Time vector characteristics
Start time 1 hours
End time 24 hours
Member Time Series Objects:
intersection1
intersection2
This portion of the example illustrates how to convert the display format of a numerical time vector to MATLAB date strings. For a complete list of the MATLAB date-string formats supported for timeseries and tscollection objects, see Time Vector Format.
To convert a numerical time vector to date strings, you must set the StartDate field of the TimeInfo property. All values in the time vector are converted to date strings using StartDate as a reference date.
For example, suppose the reference date occurs on December 25, 2004:
tsc1.TimeInfo.StartDate = 'DEC-25-2004 00:00:00';
To verify that the time vector now uses date strings, type the following command to look at the sixth element of the intersection2 member:
tsc1.intersection2(6)
MATLAB responds with
Time Series Object: unnamed
Time vector characteristics
Length 1
Start date 25-Dec-2004 03:15:00
End date 25-Dec-2004 03:15:00
Data characteristics
Interpolation method linear
Size [1 1]
Data type double
Time Data Quality
-------------------------------------------------------------
25-Dec-2004 03:15:00 16
This result shows that the sixth element of intersection2 has an interpolated data value of 16 cars at 3.25 hours (or 3:15:00).
You can plot the two remaining members in the tsc1 collection by using the following command sequence:
plot(tsc1.intersection1); hold on; plot(tsc1.intersection2)
Time Plot of Two Time Series in a Collection

This plot shows the two time series in the collection: intersection1 and intesection2. intersection1 uses the zero-order hold interpolation method and therefore has a jagged curve. In contrast, intersection2 uses a linear interpolation method. The vertical axis is labeled as intersection2 because this was the last time series plotted.
The filled circles on the plot indicate events, as specified in Defining Events.
You can specify the time vector of the timeseries object either as numerical (double) values or as valid MATLAB date strings.
When the timeseries TimeInfo.StartDate property is empty, the numerical Time values are measured relative to 0 (or another numerical value) in specified units. In this case, the time vector is described as relative (that is, it contains time values that are not associated with a specific start date).
When TimeInfo.StartDate is nonempty, the time values are date strings measured relative to StartDate in specified units. In this case, the time vector is described as absolute (that is, it contains time values that are associated with a specific calendar date). For more information, see Time Series Properties.
MATLAB supports the following date-string formats for time series applications.
| Date-String Format | Usage Example |
|---|---|
| dd-mmm-yyyy HH:MM:SS | 01-Mar-2000 15:45:17 |
| dd-mmm-yyyy | 01-Mar-2000 |
| mm/dd/yy | 03/01/00 |
| mm/dd | 03/01 |
| HH:MM:SS | 15:45:17 |
| HH:MM:SS PM | 3:45:17 PM |
| HH:MM | 15:45 |
| HH:MM PM | 3:45 PM |
| mmm.dd,yyyy HH:MM:SS | Mar.01,2000 15:45:17 |
| mmm.dd,yyyy | Mar.01,2000 |
| mm/dd/yyyy | 03/01/2000 |
Before implementing the various MATLAB functions and methods specifically designed to handle time series data, you must create a timeseries object to store the data.
The following table summarizes the syntax when using the timeseries constructor. For an example of using the constructor, see Creating Time Series Objects.
Time Series Syntax Descriptions
Syntax | Description |
|---|---|
ts = timeseries | Creates an empty timeseries object. The size of this object is 0-by-1. |
ts = timeseries(Data) | Creates a timeseries object with the specified Data. ts has a default time vector ranging from 0 to N-1 with 1-second increments, where N is the number of samples. The default name of the timeseries object is 'unnamed'. |
ts = timeseries('Name') | Creates an empty timeseries object with the name specified by a string Name. This name can differ from the timeseries variable name. |
ts = timeseries(Data,Time) | Creates a timeseries object with the specified Data array and Time. When time values are date strings, you must specify Time as a cell array of date strings. |
ts = timeseries(Data,Time,Quality) | The Quality attribute is an integer vector containing values -128 to 127 that specifies the quality in terms of codes defined by QualityInfo.Code. For more information about QualityInfo, see Time Series Properties. |
ts = timeseries(Data,..., | Optionally enter the following parameter-value pairs after the Data, Time, and Quality arguments. You can specify the following parameters:
Name and IsTimeFirst are described in Time Series Properties. |
The following table lists the properties of the timeseries object. You can specify the Data, IsTimeFirst, Name, Quality, and Time properties as input arguments in the constructor. To assign other properties, use the set function or dot notation.
Note To get property information from the command line, type help timeseries/tsprops at the MATLAB prompt. |
For an example of editing timeseries object properties, see Modifying Time Series Units and Interpolation Method.
Time Series Property Descriptions
Property | Description |
|---|---|
Data | Time series data, where each data sample corresponds to a specific time. The data can be a scalar, a vector, or a multidimensional array. Either the first or last dimension of the data must align with Time. By default, NaNs represent missing or unspecified data. Set the TreatNaNasMissing property to determine how missing data is treated in calculations. |
DataInfo | Contains fields for storing contextual information about Data:
|
Events | An array of tsdata.event objects that stores event information for this timeseries object. You add events using the addevent method. Fields in the tsdata.event object include the following:
|
IsTimeFirst | Logical value (true or false) that specifies whether the first or last dimension of the Data array aligns with the time vector. You can set this property when the Data array is square and it is ambiguous which dimension aligns with time. By default, the first Data dimension that matches the length of the time vector is aligned with Time. When you set this property to
After a time series is created, this property is read-only. |
Name | timeseries object name entered as a string. This name can differ from the name of the timeseries variable in the MATLAB workspace. |
Quality | An integer vector or array containing values -128 to 127 that specifies the quality in terms of codes defined by the QualityInfo.Code field. When Quality is a vector, it must have the same length as the time vector. In this case, each Quality value applies to the corresponding data sample. When Quality is an array, it must have the same size as the data array. In this case, each Quality value applies to the corresponding value of the data array. |
QualityInfo | Provides a lookup table that converts numerical Quality codes to readable descriptions. QualityInfo fields include the following:
The length of Code and Description must match. |
Time | Vector of time values. When TimeInfo.StartDate is empty, the numerical Time values are measured relative to 0 in specified units. When TimeInfo.StartDate is defined, the time values are date strings measured relative to StartDate in specified units. The length of Time must match either the first or the last dimension of Data. |
TimeInfo | Uses the following fields to store contextual information about Time:
|
TreatNaNasMissing | Logical value that specifies how to treat NaN values in Data:
|
Use the following methods to query and set object properties, and plot the data.
Methods for Querying Properties
Method | Description |
|---|---|
Query timeseries object property values. | |
Return the size of each data sample in a timeseries object. | |
Return data quality descriptions based on the Quality property values assigned to a timeseries object. | |
Evaluate to true for an empty timeseries object. | |
Return the length of the time vector. | |
Plot the timeseries object. | |
Set timeseries property values. | |
Return the size property of a timeseries object. | |
Open the Time Series Tools GUI. |
Use the following methods to add or delete data samples, and manipulate the timeseries object.
Methods for Manipulating Data and Time
Method | Description |
|---|---|
Add a data sample to a timeseries object. | |
Transpose a timeseries object. | |
Delete a sample from a timeseries object. | |
Subtract the mean or best-fit line and remove all NaNs from time series data. | |
Shape frequency content of time series data using a 1-D digital filter. | |
Extract a date-string time vector from a timeseries object into a cell array. | |
Get the interpolation method for a timeseries object. | |
Extract specified data samples from an existing timeseries object into a new timeseries object. | |
Apply an ideal pass or notch (noncausal) filter to a timeseries object. | |
Select or interpolate data in a timeseries object using a new time vector. | |
Set the time values in the time vector as date strings. | |
Set interpolation method for a timeseries object. | |
Synchronize and resample two timeseries objects using a common time vector. | |
Transpose a timeseries object. | |
Vertical concatenation for timeseries objects. |
To construct an event object, use the constructor tsdata.event. For an example of defining events for a time series, see Defining Events.
Methods That Define and Use Events
Method | Description |
|---|---|
Add one or more events to a timeseries object. | |
Delete one or more events from a timeseries object. | |
Create a new timeseries object by extracting the samples from an existing time series that occur after or at a specified event. | |
Create a new timeseries object by extracting the samples that occur after a specified event from an existing time series. | |
Create a new timeseries object by extracting the samples that occur at the same time as a specified event from an existing time series. | |
Create a new timeseries object by extracting the samples that occur before or at a specified event from an existing time series. | |
Create a new timeseries object by extracting the samples that occur before a specified event from an existing time series. | |
Create a new timeseries object by extracting the samples that occur between two specified events from an existing time series. |
Use the following operators to arithmetically combine timeseries objects.
Methods to Arithmetically Combine Time Series
Operation | Description |
|---|---|
+ | Add the corresponding data values of timeseries objects. |
- | Subtract the corresponding data values of timeseries objects. |
.* | Element-by-element multiplication of timeseries data. |
* | Matrix-multiply timeseries data. |
./ | Right element-by-element division of timeseries data. |
/ | Right matrix division of timeseries data. |
.\ | Element-by-element left-array divide of timeseries data. |
\ | Left matrix division of timeseries data. |
Use the following methods to calculate descriptive statistics for a timeseries object.
Methods for Calculating Descriptive Statistics
Method | Description |
|---|---|
Return the interquartile range of timeseries data. | |
Return the maximum value of timeseries data. | |
Return the mean of timeseries data. | |
Return the median of timeseries data. | |
Return the minimum of timeseries data. | |
Return the standard deviation of timeseries data. | |
Return the sum of timeseries data. | |
Return the variance of timeseries data. |
The MATLAB object, called tscollection, is a MATLAB variable that groups several time series with a common time vector. The timeseries objects that you include in the tscollection object are called members of this collection, and possess several methods for convenient analysis and manipulation of timeseries.
Before you implement the MATLAB methods specifically designed to operate on a collection of timeseries objects, you must create a tscollection object to store the data.
The following table summarizes the syntax for using the tscollection constructor. For an example of using this constructor, see Creating Time Series Collection Objects.
Time Series Collection Syntax Descriptions
Syntax | Description |
|---|---|
tsc = tscollection(ts) | Creates a tscollection object tsc that includes one or more timeseries objects. The ts argument can be one of the following:
The timeseries objects share the same time vector in the tscollection. |
tsc = tscollection(Time) | Creates an empty tscollection object with the time vector Time. When time values are date strings, you must specify Time as a cell array of date strings. |
tsc = tscollection(Time, TimeSeries, 'Parameter', Value, ...) | Optionally enter the following parameter-value pairs after the Time and TimeSeries arguments:
|
This table lists the properties of the tscollection object. You can specify the Name, Time, and TimeInfo properties as input arguments in the tscollection constructor.
Time Series Collection Property Descriptions
Property | Description |
|---|---|
Name | tscollection object name entered as a string. This name can differ from the name of the tscollection variable in the MATLAB workspace. |
Time | A vector of time values. When TimeInfo.StartDate is empty, the numerical Time values are measured relative to 0 in specified units. When TimeInfo.StartDate is defined, the time values represent date strings measured relative to StartDate in specified units. The length of Time must match either the first or the last dimension of the Data property of each tscollection member. |
TimeInfo | Uses the following fields to store contextual information about Time:
|
Use the following methods to query and set object properties, and plot the data.
Methods for Querying Properties
Method | Description |
|---|---|
Query tscollection object property values. | |
Evaluate to true for an empty tscollection object. | |
Return the length of the time vector. | |
Plot the time series in a collection. | |
Set tscollection property values. | |
Return the size of a tscollection object. | |
Open the Time Series Tools GUI. |
Use the following methods to add or delete data samples, and manipulate the tscollection object.
Methods for Manipulating Data and Time
Method | Description |
|---|---|
Add a timeseries object to a tscollection object. | |
Add data samples to a tscollection object. | |
Delete one or more data samples from a tscollection object. | |
Extract a date-string time vector from a tscollection object into a cell array. | |
Extract data samples from an existing tscollectionobject into a new tscollection object. | |
Return a cell array of time series names in a tscollection object. | |
Horizontal concatenation of tscollection objects. Combines several timeseries objects with the same time vector into one time series collection. | |
Remove one or more timeseries objects from a tscollection object. | |
Select or interpolate data in a tscollection object using a new time vector. | |
Set the time values in the time vector of a tscollection object as date strings. | |
Change the name of the selected timeseries object in a tscollection object. | |
Vertical concatenation of tscollection objects. Joins several tscollection objects along the time dimension. |
![]() | Introduction | Time Series Tools | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |