Main Content


Create a copy of lidarscanmap object

Since R2022b



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


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.


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

newMapObj = copy(orgMapObj);

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