Code covered by the BSD License  

Highlights from
Kalman filtering demo in MATLAB with automatic MATLAB-to-C code generation

Kalman filtering demo in MATLAB with automatic MATLAB-to-C code generation

by

 

05 Mar 2010 (Updated )

Kalman filtering algorithm to track an object and generating C source code for implementation

ObjTrack01(position)
% Copyright 2009 - 2010 The MathWorks, Inc.
function ObjTrack01(position)
%#eml
% Figure setup
numPts = 300;
figure;hold;grid;

% Kalman filter loop
for idx = 1: numPts
    % Get the input data
    z = position(:,idx);

    % Use Kalman filter to estimate the location
    y = kalman01(z);
    
    % Plot the results
    plot_trajectory(z,y);
end
hold;
end

Contact us