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.


Class: timeseries

Set times of timeseries object as date strings


ts1=setabstime(ts, times)
ts1=setabstime(ts, times, format)


ts1=setabstime(ts, times) sets the times in ts to the date strings specified in times.

ts1=setabstime(ts, times, format) explicitly specifies the date-string format, format, used in times.

Input Arguments


The timeseries object for which you want to set times as date strings.


A cell array of strings or a char array containing valid date or time values in the same date format.


The date-string format used for the time values.

Output Arguments


The timeseries object that results from setting times as date strings on the original timeseries object.


Create a timeseries object, and then set the absolute time vector:

ts = timeseries(rand(3,1))
ts1 = setabstime(ts,{'12-DEC-2005 12:34:56',... 
     '12-DEC-2005 13:34:56','12-DEC-2005 14:34:56'})

% View each timeseries object in the Variable Editor to see the 
% differences in the time vectors for each.

Introduced before R2006a

Was this topic helpful?