Main Content

copy

Create copy of sensor data object

Since R2024b

Description

copiedSensorDataObj = copy(sensorDataObj) creates a copy, copiedSensorDataObj, of the input sensor data object sensorDataObj.

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.

example

Examples

collapse all

Load recorded GPS data into the workspace.

load("recordedGPSData.mat")

Initialize a GPSData object using information from the loaded GPS data.

gpsData = scenariobuilder.GPSData(timestamps,latitudes,longitudes,altitudes)
gpsData = 
  GPSData with properties:

          Name: ''

    NumSamples: 392
      Duration: 19.5498
    SampleRate: 20.0513
    SampleTime: 0.0500
    Timestamps: [392×1 double]

      Latitude: [392×1 single]
     Longitude: [392×1 single]
      Altitude: [392×1 single]

    Attributes: []

Create a copy of the GPS data object.

gpsDataCopy = copy(gpsData)
gpsDataCopy = 
  GPSData with properties:

          Name: ''

    NumSamples: 392
      Duration: 19.5498
    SampleRate: 20.0513
    SampleTime: 0.0500
    Timestamps: [392×1 double]

      Latitude: [392×1 single]
     Longitude: [392×1 single]
      Altitude: [392×1 single]

    Attributes: []

Input Arguments

collapse all

Sensor data, specified as a GPSData object, Trajectory object, CameraData object, or a LidarData object.

Output Arguments

collapse all

Copy of the input sensor data object, returned as a GPSData object, Trajectory object, CameraData object, or a LidarData object. The type of the output copiedSensorDataObj matches the type of the input sensorDataObj.

Version History

Introduced in R2024b