Main Content

copy

Create a copy of lidarscanmap object

Since R2022b

Description

newMapObj = copy(scanMapObj) creates a copy of lidarscanmap object scanMapObj with the same object properties.

example

Examples

collapse all

Load a MAT file containing 2-D lidar scans into the workspace.

data = load("wareHouse.mat");
scans = data.wareHouseScans;

Create a lidarscanmap object.

orgMapObj = lidarscanmap; 

Add the first scan to the orgMapObj object.

addScan(orgMapObj,scans{1}); 

Create a copy of the orgMapObj object, then add the second scan to the copied object, newMapObj.

newMapObj = copy(orgMapObj);
addScan(newMapObj,scans{2});

Display the number of scans in the original and the copied objects.

 disp([orgMapObj.NumScans newMapObj.NumScans])
     1     2

Input Arguments

collapse all

2-D lidar scan map, specified as a lidarscanmap object.

Output Arguments

collapse all

Copy of the input lidar scan map, returned as a lidarscanmap object.

Version History

Introduced in R2022b