Watch this Author's files
Great work. Thanks a lot but I think you have a bug in the simulation. When using the delta+deviation scenario, you update the previous error (e_k1) and then do the comparison - which is wrong. You have to update e_k1 after the comparison
Contact us at files@mathworks.com