Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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 Editor to see the 
% differences in the time vectors for each.

Introduced before R2006a

Was this topic helpful?