%% Create Particle Filter Object for Online State Estimation
% To create a particle filter object for estimating the states of your system, create appropriate state transition function and measurement likelihood function for the system.
% In this example, the function vdpParticleFilterStateFcn describes a discrete-time approximation to van der Pol oscillator with nonlinearity parameter, mu, equal to 1. In addition, it models Gaussian process noise. vdpMeasurementLikelihood function calculates the likelihood of particles from the noisy measurements of the first state, assuming a Gaussian measurement noise distribution.
% Create the particle filter object. Use function handles to provide the state transition and measurement likelihood functions to the object.

myPF = particleFilter(@vdpParticleFilterStateFcn,@vdpMeasurementLikelihoodFcn);

% To initialize and estimate the states and state estimation error covariance from the constructed object, use the initialize, predict, and correct commands.
%
% Copyright 2012 The MathWorks, Inc.