This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Create tscollection object


tsc = tscollection(TimeSeries)
tsc = tscollection(Time)
tsc = tscollection(...,'Parameter',Value,...)


tsc = tscollection(TimeSeries) creates a tscollection object tsc with one or more timeseries objects already in the MATLAB® workspace. The argument TimeSeries can be a

  • Single timeseries object

  • Cell array of timeseries objects

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(...,'Parameter',Value,...) creates a tscollection object with optional parameter-value pairs you enter after specifying either a time vector or a timeseries object. You can specify the following parameter:

  • Name — String that specifies the name of this tscollection object


The following example shows how to create a tscollection object.

  1. Import the sample data.

    load count.dat
  2. Create three timeseries objects to store each set of data:

    count1 = timeseries(count(:,1),1:24,'name', 'ts1');
    count2 = timeseries(count(:,2),1:24,'name', 'ts2');
    count3 = timeseries(count(:,3),1:24,'name', 'ts3');
  3. Create a tscollection object named tsc and add to it two out of three time series already in the MATLAB workspace, by using the following syntax:

    tsc = tscollection({count1 count2},'name','tsc')


Definition: Time Series Collection

A time series collection object is a MATLAB variable that groups several time series with a common time vector. The time series that you include in the collection are called members of this collection.

Properties of Time Series Collection Objects

This table lists the properties of the tscollection object. You can specify the Time, TimeSeries, and Name properties as input arguments in the constructor.




tscollection name as a string. This can differ from the tscollection name in the MATLAB workspace.


When TimeInfo.StartDate is empty, values are measured relative to 0 . When TimeInfo.StartDate is defined, values represent date strings measured relative to the StartDate.

The length of Time must be the same as the first or the last dimension of Data for each collection .


Contains fields for contextual information about Time:

  • Units — Time units with any of the following values: 'weeks', 'days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds', 'nanoseconds'

  • Start — Start time

  • End — End time (read only)

  • Increment — Interval between subsequent time values. NaN when times are not uniformly sampled.

  • Length — Length of the time vector (read only)

  • Format — String defining the date string display format. See datestr.

  • StartDate — Date string defining the reference date. See setabstime (tscollection).

  • UserData — Any additional user-defined information

Introduced before R2006a

Was this topic helpful?