Skip to Main Content Skip to Search
Product Documentation

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.

See Also

datestr | getabstime | timeseries

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS