EKF-SLAM Simulator This version of the simulator uses global variables for all large objects, such as the state covariance matrix. While bad programming practice, it is a necessary evil for MatLab efficiency, as MatLab has no facility to avoid gratuitous memory allocation and copying when passing (and modifying) variables between functions. With this concession, effort has been made to keep the code as clean and modular as possible.