www.gusucode.com > control 案例程序 matlab源码代码 > control/CloneAnOnlineStateEstimationObjectExample.m
%% Clone an Online State Estimation Object % Create an extended Kalman filter object for a van der Pol oscillator with % two states and one output. To create the object, use the previously % written and saved state transition and measurement functions, % |vdpStateFcn.m| and |vdpMeasurementFcn.m|. Specify the initial state % values for the two states as [2;0]. obj = extendedKalmanFilter(@vdpStateFcn,@vdpMeasurementFcn,[2;0]) %% % Use |clone| to generate an object with the same properties as the % original object. obj2 = clone(obj) %% % Modify the |MeasurementNoise| property of |obj2|. obj2.MeasurementNoise = 2; %% % Verify that |MeasurementNoise| property of original object |obj| remains % unchanged and equals 1. obj.MeasurementNoise