www.gusucode.com > control 案例程序 matlab源码代码 > control/SpecifyNonAdditiveMeasurementNoiseInUKFObjectExample.m

    %% Specify Nonadditive Measurement Noise in Unscented Kalman Filter Object
% Create an unscented Kalman filter object for a van der Pol oscillator with
% two states and one output. Assume that the process noise terms in the
% state transition function are additive. That is, there is a linear 
% relation between the state and 
% process noise. Also assume that the measurement noise terms are
% nonadditive. That is,
% there is a nonlinear relation between the measurement and measurement 
% noise.
obj = unscentedKalmanFilter('HasAdditiveMeasurementNoise',false);
%%
% Specify the state transition function and measurement functions.
% Use the previously written and saved functions, |vdpStateFcn.m| and 
% |vdpMeasurementNonAdditiveNoiseFcn.m|.
%
% The state transition function is written assuming the process noise is 
% additive.  The measurement function
% is written assuming the measurement noise is nonadditive. 
obj.StateTransitionFcn = @vdpStateFcn;
obj.StateTransitionFcn = @vdpMeasurementNonAdditiveNoiseFcn;
%%
% Specify the initial state values for the two states as [2;0].
obj.State = [2;0];
%%
% You can now use the |correct| and |predict| commands to estimate the
% state and state estimation error covariance values from the constructed
% object.