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.

getTimeStr

Query tsdata.event times

Syntax

eventtimes = getTimeStr(tse,timeunits)

Description

example

eventtimes = getTimeStr(tse,timeunits) returns a cell array containing the times for each tsdata.event in an array tse with units timeunits.

Examples

collapse all

Create an array of tsdata.event objects and display their times in seconds.

tse1 = tsdata.event('MyEvent',1);
tse2 = tsdata.event('MyEvent',2);
tse = [tse1 tse2];
eventtimes = getTimeStr(tse,'seconds')
eventtimes = 1x2 cell array
    {'1.000'}    {'2.000'}

Input Arguments

collapse all

Input tsdata.event, specified as an array.

Time units, specified as 'weeks', 'days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds', or 'nanoseconds'.

Introduced before R2006a