Main Content

removeData

Remove data from actor track list object

Since R2023a

Description

removeData(trackdata,Timestamp=timestamps) removes actor information for the specified timestamps timestammps from the actorTracklist object trackdata.

example

removeData(trackdata,RowIndices=rowIndices) removes actor information for the specified row indices rowIndices from the actorTracklist object trackdata.

example

removeData(trackdata,TrackIDs=trackIDs) removes actor information for the specified track IDs trackIDs from the actorTracklist object.

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 details of the actorTracklist object.

disp(actorObject)
  actorTracklist with properties:

         TimeStamp: [600x1 double]
          TrackIDs: {600x1 cell}
          ClassIDs: {600x1 cell}
          Position: {600x1 cell}
         Dimension: []
       Orientation: []
          Velocity: []
             Speed: []
         StartTime: 3.8300e-04
           EndTime: 29.9514
        NumSamples: 600
    UniqueTrackIDs: [18x1 string]

Specify the row indices for which to remove data from the actorTracklist object.

idxs = (1:5)';

Remove the first five rows of data from the actorTracklist object.

removeData(actorObject,RowIndices=idxs)

Display the details of the actorTracklist object after data removal.

disp(actorObject)
  actorTracklist with properties:

         TimeStamp: [595x1 double]
          TrackIDs: {595x1 cell}
          ClassIDs: {595x1 cell}
          Position: {595x1 cell}
         Dimension: []
       Orientation: []
          Velocity: []
             Speed: []
         StartTime: 0.2506
           EndTime: 29.9514
        NumSamples: 595
    UniqueTrackIDs: [18x1 string]

Load an initialized actorTracklist object into the workspace.

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

Display the details of the actorTracklist object.

disp(actorObject)
  actorTracklist with properties:

         TimeStamp: [600x1 double]
          TrackIDs: {600x1 cell}
          ClassIDs: {600x1 cell}
          Position: {600x1 cell}
         Dimension: []
       Orientation: []
          Velocity: []
             Speed: []
         StartTime: 3.8300e-04
           EndTime: 29.9514
        NumSamples: 600
    UniqueTrackIDs: [18x1 string]

Extract the timestamps for which to remove data from the actorTracklist object.

ts = actorObject.TimeStamp(1:10);

Remove the data from the actorTracklist object for the specified timestamps.

removeData(actorObject,Timestamp=ts)

Display the details of the actorTracklist object after data removal.

disp(actorObject)
  actorTracklist with properties:

         TimeStamp: [590x1 double]
          TrackIDs: {590x1 cell}
          ClassIDs: {590x1 cell}
          Position: {590x1 cell}
         Dimension: []
       Orientation: []
          Velocity: []
             Speed: []
         StartTime: 0.4998
           EndTime: 29.9514
        NumSamples: 590
    UniqueTrackIDs: [18x1 string]

Load an initialized actorTracklist object into the workspace.

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

Display the recorded track IDs for the first timestamp.

disp(actorObject.TrackIDs{1})
    "4"    "13"    "22"

Specify a track ID for which to remove data from the actorTracklist object.

tid = "4";

Remove the data for the specified track ID from the actorTracklist object.

removeData(actorObject,TrackIDs=tid)

Display the recorded track IDs for the first timestamp after data removal.

disp(actorObject.TrackIDs{1})
    "13"    "22"

Input Arguments

collapse all

Actor track list information, specified as an actorTracklist object.

Timestamps for which to remove track information, specified as a scalar or an N-element column vector. N is the number of recorded timestamps for which to remove data. Units are in seconds.

After timestamp removal, the trackdata object automatically arranges the remaining timestamps in increasing order.

Data Types: single | double

Row indices of actor track list data to remove, specified as a positive integer or an N-element column vector of positive integers. N is the number of row indices of the trackdata input for which to remove data. Values must be in the range [1, NumSamples], where NumSamples is the value of the NumSamples property of the input actorTracklist object trackdata.

Data Types: single | double | uint8 | uint16 | uint32 | uint64

Track IDs of the actors for which to remove data, specified as a scalar or an N-by-1 string array. N is the number of track IDs for which to remove data from the input trackdata.

When you specify a track ID for removal, the function removes the ID from the UniqueTrackIDs property, as well as all data associated with the track ID in the ClassID, Position, Dimension, Orientation, Velocity, and Speed properties. This can result in empty elements in any property with its size determined by the number of timestamps in the data.

Version History

Introduced in R2023a