Main Content

copy

Create deep copy of state validator object

Since R2020b

    Description

    validator2 = copy(validator1) creates a deep copy of the specified state validator object.

    example

    Examples

    collapse all

    Create a validator object and set a custom validation distance.

    validator = validatorOccupancyMap3D;
    validator.ValidationDistance = 4.5
    validator = 
      validatorOccupancyMap3D with properties:
    
                       Map: [1x1 occupancyMap3D]
                StateSpace: [1x1 stateSpaceSE3]
                XYZIndices: [1 2 3]
        ValidationDistance: 4.5000
    
    

    Create a deep copy of the state validator object.

    validator2 = copy(validator)
    validator2 = 
      validatorOccupancyMap3D with properties:
    
                       Map: [1x1 occupancyMap3D]
                StateSpace: [1x1 stateSpaceSE3]
                XYZIndices: [1 2 3]
        ValidationDistance: 4.5000
    
    

    Verify that the ValidationDistance property values of the two state validator objects are equal.

    isequal(validator.ValidationDistance,validator2.ValidationDistance)
    ans = logical
       1
    
    

    Input Arguments

    collapse all

    State validator object, specified as a validatorOccupancyMap, validatorOccupancyMap3D, or validatorVehicleCostmap object.

    Output Arguments

    collapse all

    State validator object, returned as a validatorOccupancyMap, validatorOccupancyMap3D, or validatorVehicleCostmap object.

    Version History

    Introduced in R2020b