setabstime

Class: timeseries

Set times of timeseries object as date strings

Syntax

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

Description

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

ts

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

times

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

format

The date-string format used for the time values.

Output Arguments

ts1

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

Examples

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 Edtior to see the 
% differences in the time vectors for each.
Was this topic helpful?