Main Content

setabstime

Set tscollection times as date character vectors

Description

example

tscout = setabstime(tscin,timevals) sets the times in tscollection object tscin to the date character vectors specified in timevals.

tscout = setabstime(tscin,timevals,timeformat) explicitly specifies the format of timeformat used in timevals.

Examples

collapse all

Create a tscollection object and define the absolute time vector.

tscin = tscollection(timeseries(rand(3,1)));
tscout = setabstime(tscin,{'12-DEC-2005 12:34:56','12-DEC-2005 13:34:56','12-DEC-2005 14:34:56'})
Time Series Collection Object: unnamed

Time vector characteristics

      Start date            12-Dec-2005 12:34:56
      End date              12-Dec-2005 14:34:56

Member Time Series Objects:

      unnamed

Input Arguments

collapse all

Input tscollection, specified as a scalar.

Sample times, specified as a cell array of date character vectors. Valid date character vectors can have the following forms:

FormatExample
dd-mmm-yyyy HH:MM:SS01-Mar-2000 15:45:17
dd-mmm-yyyy01-Mar-2000
mm/dd/yy03/01/00
mm/dd03/01
HH:MM:SS15:45:17
HH:MM:SS PM3:45:17 PM
HH:MM15:45
HH:MM PM3:45 PM
mmm.dd,yyyy HH:MM:SSMar.01,2000 15:45:17
mmm.dd,yyyyMar.01,2000
mm/dd/yyyy03/01/2000

Data Types: cell

Time format, specified as a scalar date format used for the time values.

Introduced before R2006a