主要内容

remove

Remove data from actor track data object

Since R2025a

Description

remove(trackData,Timestamp=timestamps) removes track data for the specified timestamps timestamps from the actor track data object trackData.

remove(trackData,Timestamp=timestamps,TimeTol=timeTol) removes track data for the specified timestamps timestamps, with a tolerance time, timeTol, from the actor track data object trackData.

remove(trackData,TrackIDs=trackIDs) removes track data for the specified track IDs trackIDs from the actor track data object trackData.

example

remove(trackData,RowIndices=rowIndices) removes track data for the specified row indices rowIndices from the actor track data object trackData.

Note

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

Examples

collapse all

Load recorded actor track data into the workspace.

load("trackedActorData.mat")

Initialize an ActorTrackData object using the information from the loaded actor track data.

timestamps = trackedActorData.Timestamps;
trackID = trackedActorData.TrackID;
position = trackedActorData.Position;
trackData = scenariobuilder.ActorTrackData(timestamps,trackID,position);

Display the unique track IDs in the actor track data object.

disp(trackData.UniqueTrackIDs)
    "13"
    "22"
    "23"
    "24"
    "25"
    "26"
    "28"
    "31"
    "32"
    "33"
    "37"
    "38"
    "39"
    "4"
    "40"
    "42"
    "44"
    "45"

Specify the track IDs for which to remove data from the actor track data object.

trackIDs = ["22","23","24","25"];

Remove the data for the specified track IDs.

remove(trackData,TrackIDs=trackIDs)

Display the unique track IDs in the actor track data object after data removal.

disp(trackData.UniqueTrackIDs)
    "13"
    "26"
    "28"
    "31"
    "32"
    "33"
    "37"
    "38"
    "39"
    "4"
    "40"
    "42"
    "44"
    "45"

Input Arguments

collapse all

Actor track data, specified as an ActorTrackData object.

Timestamps for which to remove track data, specified as a nonnegative scalar, an M-element numeric column vector, an M-element datetime array, or an M-element duration array. M is the number of timestamps. The data type of the timestamps value and the data type of the Timestamps property of the input actor track data object trackData must be the same. If you specify a positive scalar or an M-element numeric column vector, units must be in seconds. Each element in the timestamps argument specifies the time at which the GPS data was collected.

When you remove track data, the actor track data object trackData arranges the remaining data by timestamps, in increasing order.

Row indices of the track data to remove, specified as a positive integer or an M-element column vector of positive integers. M is the number of rows of the trackData input from which to remove data. Values must be in the range [1, NumSamples], where NumSamples is the number of samples in the input actor track data object trackData.

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

Track IDs of the actors for which to remove track data, specified as an M-element string array of valid track IDs. M is the number of track IDs. The specified trackIDs must be a subset of the track IDs in the TrackID property of the input actor track data object trackData.

Data Types: string

Tolerance time for removing data, specified as a nonnegative scalar. Units are in seconds. For each element of timestamps, i, the function removes data samples with timestamps in the range [itimeTol, i + timeTol]. Increasing the tolerance time can increase the number of samples removed from the actor track data object trackData.

Data Types: single | double

Version History

Introduced in R2025a