Main Content

removeData

Remove data from lane data object

Since R2023a

Description

removeData(lanedata,Timestamp=timestamps) removes lane information for the specified timestamps timestammps from the laneData object lanedata.

example

removeData(lanedata,RowIndices=rowIndices) removes lane information for the specified row indices rowIndices from the laneData object lanedata.

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 LaneData object into the workspace.

data = load("laneDataObject.mat");
ld = data.ld;

Display the details of the laneData object.

disp(ld)
  laneData with properties:

           TimeStamp: [1158×1 double]
    LaneBoundaryData: {1158×1 cell}
     LaneInformation: [1158×2 struct]
           StartTime: 0
             EndTime: 57.8515
          NumSamples: 1158

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

idxs = 1:5;

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

removeData(ld,RowIndices=idxs)

Display the details of thes laneData object after data removal.

disp(ld) 
  laneData with properties:

           TimeStamp: [1153×1 double]
    LaneBoundaryData: {1153×1 cell}
     LaneInformation: [1153×2 struct]
           StartTime: 0.2497
             EndTime: 57.8515
          NumSamples: 1153

Load an initialized laneData object into the workspace.

data = load("laneDataObject.mat");
ld = data.ld;

Display the details of the laneData object.

disp(ld)
  laneData with properties:

           TimeStamp: [1158x1 double]
    LaneBoundaryData: {1158x1 cell}
     LaneInformation: [1158x2 struct]
            TrackIDs: []
           StartTime: 0
             EndTime: 57.8515
          NumSamples: 1158

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

t = ld.TimeStamp(1:10);

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

removeData(ld,Timestamps=t)

Display the details of the laneData object after data removal.

disp(ld) 
  laneData with properties:

           TimeStamp: [1148x1 double]
    LaneBoundaryData: {1148x1 cell}
     LaneInformation: [1148x2 struct]
            TrackIDs: []
           StartTime: 0.4995
             EndTime: 57.8515
          NumSamples: 1148

Input Arguments

collapse all

Recorded lane data, specified as a laneData object.

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

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

Data Types: double

Row indices of lane data to remove, specified as a positive integer or an N-element vector of positive integers. N is the number of rows of the lanedata input from which to remove data. Values must be in the range [1, NumSamples], where NumSamples is the value of the NumSamples property of the input laneData object lanedata.

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

Version History

Introduced in R2023a