Main Content

copy

Create deep copy of state validator object

    Description

    example

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

    Examples

    collapse all

    Create validator object and set custom validation distance.

    validator = validatorOccupancyMap3D;
    validator.ValidationDistance = 4.5
    validator = 
      validatorOccupancyMap3D with properties:
    
                       Map: [1×1 occupancyMap3D]
                StateSpace: [1×1 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: [1×1 occupancyMap3D]
                StateSpace: [1×1 stateSpaceSE3]
                XYZIndices: [1 2 3]
        ValidationDistance: 4.5000
    
    

    Compare the ValidationDistance property values of the two state validator object for equality.

    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.

    Introduced in R2020b