Main Content

getTimeStr

Query tsdata.event times

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
    {'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