Main Content

copy

Create copy of sensor model

Since R2022b

Description

newSensor = copy(sensor) creates a copy of the sensor model.

Note

Implementing this method is optional for a subclass of the positioning.INSSensorModel abstract class. You need to implement this method only when both of these conditions are true.

  • You need to use the copy object function of the insEKF object.

  • You want to copy at least one non-public property of the implemented sensor model.

example

Examples

collapse all

Use the copy method to copy a private property, PrivateProp.

classdef mySensor < positioning.INSSensorModel
    properties (Access = private)
        PrivateProp  % A private property 
    end
    % Implement the class as desired.
    methods
        function m = measurement(sensor, filt)
        % ....
        end
    end
    % Add a public copy method to additonally copy the private property.
        function newSensor = copy(obj)
            newSensor = obj;
            newSensor.PrivateProp = obj.PrivateProp;
        end
    end
end

Input Arguments

collapse all

Sensor model used with an INS filter, specified as an object inherited from the positioning.INSSensorModel abstract class.

Output Arguments

collapse all

Copy of the sensor model, returned as an object inherited from the positioning.INSSensorModel abstract class.

Version History

Introduced in R2022b