Main Content

setabstime

Set timeseries or tscollection times as date character vectors

Description

tsout = setabstime(tsin,timevals) sets the time vector of tsin to the date character vectors specified in timevals.

example

tsout = setabstime(tsin,timevals,timeformat) explicitly specifies the format used in timevals.

Examples

collapse all

Set date character vectors as the time values in a timeseries object.

tsin = timeseries((1:3)');
tsout = setabstime(tsin,{'12-DEC-2005 12:34:56','12-DEC-2005 13:34:56','12-DEC-2005 14:34:56'});

Input Arguments

collapse all

Input time series, specified as a timeseries or tscollection object.

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.

Version History

Introduced before R2006a