Documentation

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. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

setabstime

Set timeseries times as date character vectors

Syntax

tsout = setabstime(tsin,timevals)
tsout = setabstime(tsin,timevals,timeformat)

Description

example

tsout = setabstime(tsin,timevals) sets the times in timeseries object tsin to the date character vectors specified in timevals.

tsout = setabstime(tsin,timevals,timeformat) explicitly specifies the format of timeformat 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 timeseries, 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

Was this topic helpful?