Main Content

copy

Create copy of motion model

Description

example

newModel=copy(model) creates a copy of the motion model.

Note

Implementing this method is optional for a subclass of the positioning.INSMotionModel 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 motion model.

Examples

collapse all

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

classdef myModel < positioning.INSMotionModel
    properties (Access = private)
        PrivateProp % A private property 
    end
    % Implement the class as desired.
    methods
        function m = modelstates(~,~)  
            m = struct('Position',0,'Velocity',0); 
        end
    end
    % Add a public copy method to additionally copy the private property.
        function newObj = copy(obj)
            newObj = obj;
            newObj.PrivateProp = obj.PrivateProp;
        end
    end
end

Input Arguments

collapse all

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

Output Arguments

collapse all

Copy of the motion model, returned as an object inherited from positioning.INSMotionModel class.

Version History

Introduced in R2022b