-
-
Save HosikChae/58e388b3fcb8f069ca35dfe717c9bf44 to your computer and use it in GitHub Desktop.
Template for Kalman Filter implemented in Simulink Interpreted Function block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function y = KF(x) | |
% reference: https://www.mathworks.com/help/matlab/ref/persistent.html | |
persistent A B C D dt m1 l1 R Q P0 P; | |
% only executed at the first time -> initialization | |
if isempty(P) | |
% A = ...; B = ...; C = ...; D = ...; | |
% R = ...; Q = ...; P0 = ...; | |
% m1 = ...; l1 = ...; dt = ...; | |
end | |
%% do KF | |
% Prediction | |
% ... | |
% Innovation | |
% ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment