i used sfunction (m-code)in my programm(extended kalman filter),i have not a good result;ihave 5 discrets states and plus the states equations we have error covariance Pe to calculate (reccurant equation) every itteration (in flag 2):when i used the debug i see that Pe calculated is not used in the after itteration but Pe initial.

i writed Pe initial before flag 0

thank you. ]]>

I decided to highlight a few basic concepts using MATLAB S-Function because, in my opinion, it is easier to understand and debug. But I agree with you that C S-Functions offer a lot more possibility and will be useful for more users.

]]>