Main Content

updateTime

Update timestamps of actor track list object

Since R2023a

Description

updateTime(trackdata,timestamps) updates the timestamps of the actorTracklist object with the specified timestamps timestamps.

example

updateTime(trackdata,fhandle) updates the timestamps of the actorTracklist object with the specified function fhandle.

Note

This function requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install Scenario Builder for Automated Driving Toolbox from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

example

Examples

collapse all

Load an initialized actorTracklist object into the workspace.

actorObject = load("actorTracklistObject.mat");
actorObject = actorObject.actorObject;

Display the first few timestamps of the actorTracklist object.

head(actorObject.TimeStamp)
    0.0004
    0.0507
    0.1006
    0.1504
    0.2003
    0.2506
    0.3003
    0.3502

Extract all recorded timestamps from the actorTracklist object.

t = actorObject.TimeStamp;

Offset each timestamp by 10 seconds.

t = t + 10;

Update the timestamps of the actorTracklist object.

updateTime(actorObject,t);

Display the first few updated timestamps of the actorTracklist object.

head(actorObject.TimeStamp)
   10.0004
   10.0507
   10.1006
   10.1504
   10.2003
   10.2506
   10.3003
   10.3502

Load an initialized actorTracklist object into the workspace.

actorObject = load("actorTracklistObject.mat");
actorObject = actorObject.actorObject;

Display the first few timestamps of the actorTracklist object.

head(actorObject.TimeStamp)
    0.0004
    0.0507
    0.1006
    0.1504
    0.2003
    0.2506
    0.3003
    0.3502

Update the timestamps of the actorTracklist object with a linear offset of 10 seconds by specifying a function handle.

updateTime(actorObject,@(t)t+10);

Display the first few updated timestamps of the actorTracklist object.

head(actorObject.TimeStamp)
   10.0004
   10.0507
   10.1006
   10.1504
   10.2003
   10.2506
   10.3003
   10.3502

Input Arguments

collapse all

Actor track list information, specified as an actorTracklist object.

Timestamps with which to update actor information, specified as an N-element nonnegative column vector. N must be the same as the value of the NumSamples property of the input actorTracklist object trackdata. The input timestamps must be in increasing order. Units are in seconds.

Data Types: single | double

Timestamp update function, specified as a function handle. The updateTime function applies fhandle to every element of the TimeStamp property of the actorTracklist object. fhandle must have this function syntax:

timeout = newTime(timein),
where timein is the timestamps from the TimeStamp property, specified as an N-by-1 nonnegative column vector, and timeout is the updated timestamps.

Version History

Introduced in R2023a