Code covered by the BSD License  

Highlights from
Kalman filtering framework

image thumbnail
from Kalman filtering framework by David Ogilvie
Object framework for filtering using Kalman filter, EKF, or UKF.

ekfTransform(f, J_x, mu, P, Q, curTime, isLinearNoise, J_v)
function [y S C] = ekfTransform(f, J_x, mu, P, Q, curTime, isLinearNoise, J_v)
%function [y S C] = ekfTransform(this, predMean, predCov, meas, curTime)
        % TODO: allow for multiple steps
    if nargin <= 6
        isLinearNoise = true;
    end

    H = J_x(mu, curTime);
    
    if isLinearNoise
        y = f(mu, curTime);
        S = H * P * H' + Q;
    else
        zeroNoise = zeros(size(this.Q,1), 1);
        y = f(mu, t, zeroNoise);
        M = J_v(mu, curTime);
        S = H * P * H' + M * Q * M';        
    end
    
    C = P * H';
end

Contact us at files@mathworks.com